开发者

Observer for Magent product after save

I am trying to add Observer to the Product status update event on backend. But it does not triggering the event.

<?xml version="1.0"?>      
<config>     
    <modules>      
        <Mage4u_Customredirect>     
            <version>0.1.0</version>      
        </Mage4u_Customredirect>      
    </modules>     
    <global>        
        <events>     
            <catalog_product_status_update>      
                <observers>     
                    <Mage4u_Customredirect_Catalog_product>     
                        <type>singleton</type>  
                    <class>mage4u_customredirect/observer</class>   <method>on_catalog_product_status_update</method>  </Mage4u_Customredirect_Catalog_product>              

                </observers>  
            </catalog_product_status_update> 
        </events>  
    </global>    
</config> 

And the observer function is to receive the status of the product that was updated and based on that i need to update it in another server.

<?php


c开发者_JS百科lass Mage4u_Customredirect_Model_Observer
{


    public function on_catalog_product_status_update(Varien_Event_Observer $observer)
    {  
        Mage::log("test " ,null,"test");

        var_dump($observer);die();  

        }


}


?>

But it does not triggering this event. Please can someone tel me why its not working.


You should use the same notation here for class name as you use in Mage::getModel() factory method, e.g.: <class>mage4u_customredirect/observer</class>. Do not forget delete cache after this change to make it work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜