I have created an ordering app for a customer. However, I do not want people to be able to place orders outside of the operating hours of the restaurant.
Is there a way to create a button that is only viewable during certain times? I have tried everything I can think of and cannot get this to work.
For example - if a user clicks on the “start order” button, they will be taken to the order screen if the hours are between 8 am - 8:30 pm (for example). If the current time is outside of that window, user will get a popup saying restaurant is closed, please come back and order between 8:00 am - 8:30 pm.
Is there a way to accomplish this?
Yes. There is a way. You’ll need to store the open and closed time as a unix number based on the times you want open/closed. Then you’ll need to use hidden inputs and calculations in order to calculate the current time vs the times calculated.
For example, if a store opens at 8:00am, store the number 0.333333333333333 (1 / 24 * 8) and if it closes at 5:00pm, store the closed number 0.708333333333333 ( 1 / 24 * 17).
Input 1 should contain a custom formula Start of today + open time.
Input 2 should contain a custom formula Start of today + closed time.
Add 2 buttons, 1 for when the store is open and 1 for when it’s closed. If current time is between input 1 and input 2, display open button that can process can order. If current time less than input 1 or greater than input 2, display closed button that displays the pop up.
If you need further assistance setting this up, feel free to reach out to me for a 1-on-1 mentoring session.
Awesome! Thank you so much. I will give this a try and see if it works.
I appreciate your help.