I’m working on an extension that will receive CatalogEvent information from Magento (Enterprise) when saved and do custom processing on the information.
Here’s the code I use to listen to the event:
<?xml version="1.0"?>
<config>
<global>
<models>
<mage4ucustomredirect>
<class>Mage4u_Customredirect</class>
</mage4ucustomredirect>
</models>
<events>
<enterprise_catalogevent_event>
<observers>
<abc>
<type>singleton</type>
<class>Mage4u_Customredirect_Model_Observer</class>
<method>on_enterprise_catalogevent_event</method>
</abc>
</observers>
</enterprise_catalogevent_event>
</events>
</global>
</config>
and this is the observer:
class Mage4u_Customredirect_Model_Observer
{
public function on_enterprise_catalogevent_event(Varien_Event_Observer $observer)
{
Mage::log( "on_enterprise_catalogevent_event" );
}
}
?>
When I save the CatalogEvent, I do not receive the call. Can you spot any problems with my code?
Your observer isn’t called, because
enterprise_catalog_eventis a model, but not an event.See
app/code/core/Enterprise/CatalogEvent/etc/config.xml:Afaik
enterprise_catalogevent/eventdoes not dispatch its own save events, but you could observe the genericmodel_save_beforeormodel_save_afterevent, to receive callbacks whenever such model is being created/saved.You just need to identify the object being passed to these generic events first: