2

You can create events.xml file here and you can use checkout_submit_all_after event there. app/code/Vendor/Module/etc/adminhtml/events.xml Content for this file is.. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event ...


1

We are using the event sales_order_invoice_pay to generate a order PDF. See also this question on that event. When that event is dispatched payment information should be available.


1

Use the following event global scope. Ex. VendorName/ModuleName/etc/events.xml checkout_submit_all_after For Paypal payment method, use the following: paypal_express_place_order_success


1

The event sales_order_save_before is been dispatched when an entity of Sales Order is been saved. The class which is reponsible for dispatching sales_order_save_before event is the model of order Magento\Sales\Model\Order. In order to get to the dispatch statement, you need to look for the beforeSave method into inheritance heirarchy of this model. If you ...


1

I have found that this event are dispatched in Magento\Framework\Model\AbstractModel.php /** * Processing object before save data * * @return $this */ public function beforeSave() { if (!$this->getId()) { $this->isObjectNew(true); } $this->_eventManager->dispatch('...


1

You can use sales_order_invoice_save_after to deduct product quantity after generate credit memo : Create config.xml for define event and module : app/code/local/RH/StockDeduct/etc/config.xml <?xml version="1.0"?> <config> <modules> <RH_StockDeduct> <version>1.0.0</version> </...


1

Calling any method with expects once() will increase your invoke count by one. You can find reference in PHPUnit\Framework\TestCase class : /** * Returns a matcher that matches when the method is executed exactly once. * * @return InvokedCountMatcher */ public static function once() { return new InvokedCountMatcher(1); ...


Only top voted, non community-wiki answers of a minimum length are eligible