1

I have created a config in the backend under System > Config. The configuration allows the user to essentially turn the store on or off (it displays a message that the store is closed, and disables the add to cart button). What I would like to do is set up a cron job so that instead of having to log in every morning and enable the store through this config, and then at the end of the day, disable the config.

Is it possible to do this through the magento cron jobs menu or will I have to somehow write all this myself?

Thanks!

1

If you want to change a configuration from the admin while running a cronjob you will have to code it yourself.

You can use Magento cronjob or create your own in your server with crontab -e in most of the *nix distributions.

Here is a guide from Inchoo to achieve that. From there:

$inchooSwitch = new Mage_Core_Model_Config();
/*
*turns notice on
*/
$inchooSwitch ->saveConfig('design/head/demonotice', "1", 'default', 0);
/*
*turns notice off
*/
$inchooSwitch ->saveConfig('design/head/demonotice', "0", 'default', 0);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.