开发者

Magento: Find observers for dispatched events?

开发者 https://www.devze.com 2023-04-12 17:26 出处:网络
开发者_JS百科I need to find which methods fire when the following event is dispatched Mage::dispatchEvent(\'sales_quote_add_item\', array(\'quote_item\' => $item));

开发者_JS百科I need to find which methods fire when the following event is dispatched

   Mage::dispatchEvent('sales_quote_add_item', array('quote_item' => $item));

I know how to create custom event hook and that it should stay in config.xml, but I can't find hook for this sales_qute_add_item in any of config XMLs.


It's OK. In Magento is no default listener for this event. This event has been added by Magento core team specially for customization purposes.


do it like this

<events>
    <sales_quote_add_item>
        <observers>
            <your_observer_name>
                <type>model</type>
                <class>Your_Observer_Class</class>
                <method>yourObserverMethod</method>
            </your_observer_name>
        </observers>
      </sales_quote_add_item>
</events>


Just search all the config xml files for

<sales_quote_add_item>

If it is in a events tag then look at the method and class to see what file it is in.

0

精彩评论

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

关注公众号