我正在尝试观察_prepareForm()方法中app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php文件中调度的adminhtml_block_salesrule_actions_prepareform事件。但是我一直收到错误消息,我不确定为什么吗?



这是模块中config.xml的一部分-我不是在做错什么吗?

  <adminhtml>
        <events>
            <adminhtml_block_salesrule_actions_prepareform>
                <shoppingcartrules>
                    <class>shoppingcartrules/observer</class>
                    <method>prepareForm</method>
                </shoppingcartrules>
            </adminhtml_block_salesrule_actions_prepareform>
        </events>
    </adminhtml>

最佳答案

我发现了...在我的XML中缺少该节点。

<adminhtml>
    <events>
        <adminhtml_block_salesrule_actions_prepareform>
            <observers>
                <shoppingcartrules>
                    <class>shoppingcartrules/observer</class>
                    <method>prepareForm</method>
                </shoppingcartrules>
            </observers>
        </adminhtml_block_salesrule_actions_prepareform>
    </events>
</adminhtml>

关于php - magento事件不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8115043/

10-16 19:12