Magento 观察者仅在管理面板中触发,我如何在前端也执行它?
我有一个在管理后端运行良好的观察者,事件的名称是 *checkout_submit_all_after*。当我作为客户下订单时,事件没有被触发,也许我错过了配置文件中的某些内容,这里是 config.xml
<config>
<modules>
<MyFancyModuleName>
<version>0.1.1</version>
</MyFancyModuleName>
</modules>
<global>
<events>
<checkout_submit_all_after>
<observers>
<awesome>
<type>singleton</type>
<class>MyFancyModuleName_Model_Observer</class>
<method>this_is_a_magic_function</method>
</awesome>
</observers>
</checkout_submit_all_after>
</events>
</global>
</config>
非常感谢!
I've an observer that works well in the admin back-end, the name of the event is *checkout_submit_all_after*. When I make an order as a customer the event is not fired, maybe I miss something in the configuration file, here the config.xml
<config>
<modules>
<MyFancyModuleName>
<version>0.1.1</version>
</MyFancyModuleName>
</modules>
<global>
<events>
<checkout_submit_all_after>
<observers>
<awesome>
<type>singleton</type>
<class>MyFancyModuleName_Model_Observer</class>
<method>this_is_a_magic_function</method>
</awesome>
</observers>
</checkout_submit_all_after>
</events>
</global>
</config>
many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确认该事件是在前端触发的吗?这看起来不像我以前在前端见过的事件。
在不知道您要做什么的情况下,您似乎可能想要使用 sales_order_place_before 或 sales_order_place_after 事件。 (在前端下订单之前或之后触发)
Have you confirmed that the event is fired on the front end? That does not look like an event that I have seen on the frontend before.
Without knowing what you are looking to do it looks like you may want to use the sales_order_place_before or sales_order_place_after event. (gets triggered just before or after an order is placed on the frontend)