Hi i am tring to set up cron in magento using config.xml. but anyreason its not working, Here is the code which i am using.
config.xml
<?xml version="1.0"?>
<config>
<global>
<models>
<mycompany_mymodule>
<class>Mycompany_Mymodule_Model</class>
</mycompany_mymodule>
</models>
</global>
<crontab>
<jobs>
<mycompany_mymodule>
<schedule><cron_expr>*/10 * * * *</cron_expr></schedule>
<run><model>mycompany_mymodule/observer::importproduct</model></run>
</mycompany_mymodule>
</jobs>
</crontab>
</config>
Observer.php
<?php
class Mycompany_Mymodule_Model_Observer {
public function Importproduct() {
Mage::log('cron works!!',null,'cron.log');
}
} ?>
but its not working, can anybody help me. Thank you in advance..
app/etc/modules/? In other words, did you check whether the module itself is loaded at all? – Rick Kuipers May 21 '13 at 12:50<run><model>mycompany_mymodule/observer::importproduct</model></run>where you call the function importproduct and in your PHP code it's Importproduct, note the capital. – Rick Kuipers May 21 '13 at 12:53