This question already has an answer here:
Some of my trousers can't keep the fly up. It's annoying and sometimes awkward to get it up, particulary in public.
How can I prevent them from opening while walking?
One solution I already know is to fix it with a paperclip, but then, when I go to the restroom, I have to "unlock" this fixture which is annoying again.