If you want to try and fix it in situ, then it becomes a pain as you'll have lost the pin and/or some of the plastic it goes into will have disappeared.
I bought a replacement from a breakers for £40-ish and just swapped the lock over before fitting it.