Discy 最新 问题

  • 0

在Magento 2中有很多可用的事件,一些付款,发票或订单取消操作的事件如下, 1. order_cancel_after 取消订单后将使用此事件。如果您想在取消订单后做某事,可以使用此事件。 代码在 vendor/magento/module-sales/Model/Order.php at cancel() function. $this->_eventManager->dispatch('order_cancel_after', ['order' => $this]);   2. sales_order_invoice_cancel 允许您在取消订单时取消订单发票 代码在vendor/magento/module-sales/Model/Order/Invoice.php at cancel() function. $this->_eventManager->dispatch('sales_order_invoice_cancel', [$this->_eventObject => $this]); 3. sales_order_payment_cancel_invoice 允许您在取消订单时取消订单发票 代码在vendor/magento/module-sales/Model/Order/Invoice.php at cancel() function. $this->_eventManager->dispatch('sales_order_invoice_cancel', [$this->_eventObject => $this]); 4. sales_order_payment_cancel_creditmemo 代码在vendor/magento/module-sales/Model/Order/Payment.php using cancelCreditmemo() function $this->_eventManager->dispatch( ...