lpfernandes Posted October 2, 2010 Share Posted October 2, 2010 HiIs there a way to define store opening times in order to only accept order during those periods, and when orders are placed outside that period an error message is displayed.Thanks Link to comment Share on other sites More sharing options...
rocky Posted October 3, 2010 Share Posted October 3, 2010 No, PrestaShop has no option. I'm not sure why you would want to do that though, since you will be missing out on sales. Surely, the customers can wait a little longer for you to process their order? Link to comment Share on other sites More sharing options...
lpfernandes Posted October 5, 2010 Author Share Posted October 5, 2010 The reason behind the question is that the shop is a restaurant take away, and during closing times customers should not be able to place orders. The ideal solution in fact would be to have some added options when the customers place the order to select when they want their order to be delivered (date and time), since this seems more complicated I thought that the shop could simply close during closing times. The solution I have now implemented is to use the maintenance mode to work as if the shop is closed. Link to comment Share on other sites More sharing options...
rocky Posted October 6, 2010 Share Posted October 6, 2010 PrestaShop v1.4 has a "Date of delivery" module that lets the customer specify when they want their order delivered. I think it relies on hooks added to v1.4 though, so it won't work in v1.3.2.Until v1.4 is released, the only solution I can think of is to write a cron script that automatically puts the website into maintenance mode. I don't have time to come up with a proper solution, but a file called shop_enable.php in the root directory with something like the following should work: <?php include(dirname(__FILE__).'/config/config.inc.php'); if ($_GET['password'] == 'password') Db::getInstance()->execute("UPDATE `"._DB_PREFIX_."configuration` SET `value` = 1 WHERE `name` = 'PS_SHOP_ENABLE'"); ?> and a file called shop_disable.php with the following: <?php include(dirname(__FILE__).'/config/config.inc.php'); if ($_GET['password'] == 'password') Db::getInstance()->execute("UPDATE `"._DB_PREFIX_."configuration` SET `value` = 0 WHERE `name` = 'PS_SHOP_ENABLE'"); ?> Change the second 'password' to a password to prevent anyone but yourself running the script, then create a cron job in your cPanel to execute shop_disable.php?password=password when you want the shop to close and another cron job to execute shop_enable.php?password=password when you want the shop to open. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted October 6, 2010 Share Posted October 6, 2010 I would also modify the maintenance template to show that the restaurant is closed vs. the store is down for maintenance. Link to comment Share on other sites More sharing options...
lpfernandes Posted October 13, 2010 Author Share Posted October 13, 2010 Thanks guys for your help, I have now changed the maintenance page to a store close page and implemented the php scripts onto the crontab in order for the shop to automatically switch from enable and disable mode. Link to comment Share on other sites More sharing options...
cesarpenafiel Posted July 4, 2011 Share Posted July 4, 2011 Hello,I have been using this technique of updating the configuration table to open and close my store and it worked great...until I enabled system caching. Anybody know of a way (through code) to force a flush on the system cache? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now