Can you replace just the lock, or do you have to replace the whole sliding glass door?

I accidently (i promise) slammed my sliding glass door while it was locked (but opened) and now when i try to lock it while its closed the lock just falls down. Can I replace just the parts that lock it or am I looking at a whole new door? If so, how much do doors cost?