开发者

Magento Cron file inclusion error

I have first time installed th cron job for magento. THere is one module that has a cronjob setup like following in config.xml

<crontab>
    <jobs>
        <campaigns_observer_discount>
            <!-- each 7 minutes -->
            <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>
            <run><model>campaigns/observer::discountExpiryAlert</model></run>
        </campaigns_observer_discount>

    </jobs>
</crontab>

When cron.php runs the magento is looking for file under mage directory not in local folder the error states as follows

2011-08-12T13:38:07+00:00 ER开发者_JAVA技巧R (3): Warning: include(Mage/Campaigns/Model/Observer.php): failed to open stream: No such file or directory  in /var/www/website/src/magento/lib/Varien/Autoload.php on line 93

It should look for Namespace/Campaigns/Model/Observer.php . I tried to change the parameter in config.xml

<run><model>namespace_campaigns/observer::discountExpiryAlert</model></run>

then magento looks for file Mage/Namespace/Campaigns/Model/Observer.php

Can any body suggest me where I am going wrong? THanks, ur help is much appreciated


Magento doesn't know your "Namespace" and automatically prepends Mage therefore. There is another error in your config.xml, most likely in the global/model part:

<models>
    <campaigns>
        <class>Namespace_Campaigns_Model</class>
    </campaigns>
</models>

should be the correct definition according to your sample code above.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜