Create a show and hide button for an item in my collection

I’m creating a dashboard in which restaurants can manage their menus. Once managed, menu items are automatically updated in a dynamic “menu” page.

I’ve managed to configure almost everything, but there’s one thing I’d like help with. They can add a product, delete it but I’d like to give them the option of just hiding a product without deleting it. That when they click on a button or check a box, the product is just hidden from the dynamic menu, but still existing in the collection, and that when they replicate the product is displayed again in my menu.

Do you have any idea how to do this?

Thanks in advance!

A pretty basic way of doing this would be to add an extra text field to your database which they have to fill in when submitting menus. Have the submission state something like: Make Product Public? “yes”/“no” and an input for them to type one of those options into. Then on your dynamic page filter out any “no” responses.

There’s probably a nicer way to do this with a bit of code and checkboxes instead but if you get really stuck for alternatives that’s a super easy way of doing it!

thank you very much for your reply! It’s true that it’s a possibility, but if someone who knows a bit about code can give me a tip, that would be even better :smiley:

1 Like