【问题标题】:what's the event name when you create a new invoice in magento?在 magento 中创建新发票时的事件名称是什么?
【发布时间】:2011-12-01 11:10:28
【问题描述】:

当您在管理面板中创建发票时,观察者的该事件的名称是什么?我试过 *sales_order_invoice_register* 和 *sales_order_invoice_pay* 但它不起作用。

【问题讨论】:

  • 这应该是sales_order_invoice_register。请更具体地定义“但它不起作用”并显示导致问题的代码。

标签: magento observer-pattern invoice


【解决方案1】:

对于 Magento >= 1.4,有几个选项 - 最好的选择是您列出的事件,sales_order_invoice_register

由于发票模型将_eventPrefix属性设置为sales_order_invoice,所以可以观察sales_order_invoice_save_after

确保您使用的是正确的事件配置区域:adminhtml vs frontend vs global。

【讨论】:

    猜你喜欢
    • 2012-10-23
    • 2012-08-11
    • 1970-01-01
    • 1970-01-01
    • 2018-09-16
    • 2017-06-17
    • 2013-03-11
    • 2017-03-09
    • 2023-03-12
    相关资源
    最近更新 更多