nickny Posted December 1, 2011 Share Posted December 1, 2011 Hi all, Is there a way to turn off my store at 9pm? Or let people browse, but disable the Checkout button? Thanks Nick Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted December 1, 2011 Share Posted December 1, 2011 Sure.....at 9pm each evening you can put your store in 'catalog mode'. They can browse but not buy. Hope that helps! Marty Shue Link to comment Share on other sites More sharing options...
Mike Kranzler Posted December 1, 2011 Share Posted December 1, 2011 Hi Nick, In your Back Office, there is an option to enable Catalog Mode under Preferences > Products. That will prevent users from being able to add anything to their cart. I couldn't tell you the code you'll need to create in order to set it to automatically disable at 9PM each day, but I'm sure someone more experienced on the development side here on the forums could help you out with that. I hope this helps. -Mike Link to comment Share on other sites More sharing options...
Seth Oscar Posted December 6, 2011 Share Posted December 6, 2011 +1!! I need to be able to set store hours on my site as well, if anyone has any clue how to do this I'm very interested. Manually changing from catalog mode to fully operational twice a day is just not feasible. Any takers? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted December 6, 2011 Share Posted December 6, 2011 Running this code on a cron job at 9pm and again at the time you want to open your store, will change the catalog mode. Place it in the root of your store: <?php include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/init.php'); if (!Configuration::get('PS_CATALOG_MODE')) { Configuration::updateValue('PS_CATALOG_MODE', true); } else { Configuration::updateValue('PS_CATALOG_MODE', false); } ?> This is not tested because I don't have a store installed at this time. I can test it tonight at home and let you know. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted December 6, 2011 Share Posted December 6, 2011 Sample cron job to run it. 1. Replace /home/mystore/public_html/ with absolute path to the root of your store to place the log file. 2. Replace http://www.mystore.com/ with the URL to your store 3. Replace 6,21 with the hours you want to open and close your store. I set to 6am and 9pm. 0 6,21 * * * wget -a /home/mystore/public_html/catalog_mode.txt http://www.mystore.com/catalog_mode.php -O /dev/null Link to comment Share on other sites More sharing options...
Seth Oscar Posted December 7, 2011 Share Posted December 7, 2011 I saw something about cron jobs in an older post but I couldn't get it to work. You sir, are a lifesaver. Thanks so much for this. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted December 7, 2011 Share Posted December 7, 2011 Thanks MrBaseball! -Mike Link to comment Share on other sites More sharing options...
MrBaseball34 Posted December 7, 2011 Share Posted December 7, 2011 So I'm assuming it actually worked for you? I was unable to test it at home last night and wrote that code strictly off the top of my head. Link to comment Share on other sites More sharing options...
Seth Oscar Posted December 9, 2011 Share Posted December 9, 2011 Worked like a charm. Still the issue with prices not showing while in catalog mode, but I don't think there's a way around that. Thanks again for your help! Link to comment Share on other sites More sharing options...
sooroos Posted August 22, 2013 Share Posted August 22, 2013 (edited) hi, i could not make this working, i think the php file described in post #5 is not working with p.s. 1.5.4.1 i have set correctly a test cron job with: crontab -e via putty and then i used for test: * * * * * /usr/bin/wget http://www.mysite.com/test.php <?php mail('[email protected]','Cron Job Test Script',phpversion()); ?> and it worked but when i add the file copied from post#5 the cron job says it is installed correctly but nothing happens in FO, i mean the catalog mode is not activated. Can someone help? i have used mailto and i have received the error: "HTTP request sent, awaiting response... 503 temporarily overloaded 2013-08-22 07:26:02 ERROR 503: temporarily overloaded." Edited August 22, 2013 by sooroos (see edit history) Link to comment Share on other sites More sharing options...
sooroos Posted August 22, 2013 Share Posted August 22, 2013 i really need it i know there are guys here who can make this work Link to comment Share on other sites More sharing options...
Recommended Posts