Is there a way to allow the add-to-cart only during store hours?
This is for online ordering for a restaurant. Do not want people sending order if the store is closed.
Thanks,
Jeff
Is there a way to allow the add-to-cart only during store hours?
This is for online ordering for a restaurant. Do not want people sending order if the store is closed.
Thanks,
Jeff
You can certainly write/or hire someone to write a simple cronjob to do that. The job just have to change the store mode to view price only when it closes, and change back to normal when it opens. Or you can do it manually.
I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me
Thanks for the reply.
After reading about cron jobs, it seems they run at a set time.
Would it work if a code was added to index.php (I think that's where it is needed) that would do the date/time checks and set "STORE_STATUS" for the current session?
I think the answer to my question depends on whether STORE_STATUS is set once or if it is read from the database multiple times? If read once, my logicsays this will work. If read multiple times, the program would need to update the table. This leads to the question of if I am correct that index.php would always be executed upon entering the site preventing someone from getting an incorrect status?
Sorry I took so long to respond. I missed your reply somehow.
Jeff
What if someone is online for an hour before your restaurant closes, and orders after that?
The check really needs to happen when an order is placed, and possibly also when the add to cart is clicked.
I dont understand why you dont like the idea of having cronjob running at certain time. It seems to help you with your requirement. Or is there any I'm missing?
I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me
yellow1912,
The site will potentially host hundreds of restaurants, each a separate ZC install on a single server. My thought process was that it might be easier to just have a single mod on each site that checked a store hours table (one table created for each store).
After giving more thought to your suggestion, I do like your idea. I'm sure the routine could run every half hour and check if any stores need to be updated. That makes sense.
gjh42,
Good question! I'm going to have to test this. I'll see what happens if I change the store status after beginning order entry.
Thanks to all. I really appreciate the help.