![store manager for magento protected import file store manager for magento protected import file](https://theecommmanager.com/wp-content/uploads/2017/05/MAGENTO-2-PRODUCT-IMPORT-TEMPLATE-–-ADDITIONAL-ATTRIBUTES-COLUMN-HACK-Paste-Special.png)
All the coding that has to be done is to create our own backend model that will format and save the values to path we want. Inside the system.xml will be time (hour, minute and second) and frequency selectors (daily, weekly and monthly) that already come packed within Magento. As you can make it whatever and however you want, I’m not going to do the miracles here but I’ll use what Magento already offers to us. So let’s get to work! Admin configurationĪs we want to have schedule-configurable cron we have to have an admin configuration for that. Having that in mind, we could save the path to the cron schedule and set any (valid) value we want. Inside the Mage_Cron_Model_Observer class, which generates cron jobs, there’s a “generate” method that also checks for the values inside core_config_data table in the same way as it does for config.xml files. The thing about this is that the schedule cannot be configured…yet. */5 * * * * mymodule/observer::doSomething If you’re not familiar with the cron schedule format, there’s a bunch of the articles and cron generators on the internet. A sample below shows a cron job named “my_cron” that runs “doSomething” method inside the observer file every five minutes.
![store manager for magento protected import file store manager for magento protected import file](https://store.emagicone.com/pub/media/catalog/product/p/r/product_label_mag_pro_pri.png)
#STORE MANAGER FOR MAGENTO PROTECTED IMPORT FILE CODE#
As seen in the code below, it is defined in a config.xml file with two main parts: schedule and a method to be ran. But what happens if you want to spice it up a bit and create a schedule-configurable cron? Fortunately for us, Magento has that already included in the system and it’s pretty easy to implement.Ĭron itself is more or less straightforward. A few lines in config.xml, a method and it’s done. Cron in Magento is fairly easy to configure.