neymarinho Posted December 30, 2013 Share Posted December 30, 2013 Hello everyone, I would like to have a cron that would enable and disable certain products at certain time. I would like to disable all the products from a certain manufacturer and enable them at another time. How can I do this?? Thank you very much, Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 30, 2013 Share Posted December 30, 2013 Hi. You need to write a script that handles the enable and another one that handles the disable. You set them up as cronjobs from your hosting control panel. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
neymarinho Posted December 30, 2013 Author Share Posted December 30, 2013 Yeah but what is the mysql command to disable/ enable products? Link to comment Share on other sites More sharing options...
vekia Posted December 30, 2013 Share Posted December 30, 2013 UPDATE ps_productshop_shop set active=0 WHERE id_product = 123 where 123 is an id of product you want to disable. Link to comment Share on other sites More sharing options...
neymarinho Posted December 31, 2013 Author Share Posted December 31, 2013 I manage to develop this: $retval = Db::getInstance()->execute(' UPDATE 'ps_product' SET 'available_for_order'= 0 WHERE 'id_manufacturer' = 3 '); echo 'Done with return: '.print_r($retval,1).PHP_EOL; Not working, any idea why? Link to comment Share on other sites More sharing options...
vekia Posted December 31, 2013 Share Posted December 31, 2013 by "not working" you mean, that you have some parse errors ? or that products are still "available for order" ? Link to comment Share on other sites More sharing options...
neymarinho Posted December 31, 2013 Author Share Posted December 31, 2013 (edited) The cron is not giving me any error message and the page doesn't print any success message or error message. Edited January 1, 2014 by neymarinho (see edit history) Link to comment Share on other sites More sharing options...
neymarinho Posted January 1, 2014 Author Share Posted January 1, 2014 Still not working with the code: $retval = Db::getInstance()->execute(' UPDATE 'ps_product' SET 'available_for_order'= 0 WHERE 'id_manufacturer' = 3 '); echo 'Done with return: '.print_r($retval,1).PHP_EOL; ?> Any idea??? 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