Frankie Healy Frankie Healy - 1 year ago 88
PHP Question

Magento Cron Job Error - Invalid Callback

Im having some issues getting a cron job to work within Magentos cron system.

My module folder structure is as follows:



My config xml is as follows:


The module's node contains basic
information about each Magento module
This must exactly match the namespace and module's folder
names, with directory separators replaced by underscores

<!-- The version of our module, starting at 0.0.1 -->


<!-- Defining models -->

Unique identifier in the model's node.
By convention, we put the module's name in lowercase.

The path to our models directory, with directory
separators replaced by underscores



<cron_expr>*/5 * * * *</cron_expr>

My observer class looks like this:

class Nnn_AbandonedCartEmails_Model_Observer
public function processEmails()


So the cron job is registering and is added to the cron_schedule table, however whenever it attempts to execute it produces and error along the lines of

exception 'Mage_Core_Exception' with message 'Invalid callback: abandonedcartemails/observer::processEmails does not exist' in /pathtosite/www/app/Mage.php:594

So it looks like I have a config issue, but I cant seem to see where the problem lies. The namespacing and naming conventions in Magento's xml files are quite frustrating to work with, so hopefully a fresh pair of eyes can see where I have made the mistake.

Any help always appreciated.


Answer Source

Your model name is wrong.

In <model> tag, write <abandonedcartemails> instead of <nnn_abandonedcartemails>.

Your model is not calling. That is why this is error

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download