I am creating a module where I am adding an observer to the event sales_order_save_after which checks the order status and then sends an invoice e-mail. However, the event is only valid if the order is saved, e.g. create a shipment. This is not what I need.

Is there an event to catch an order status change (the order status is changed from processing to complete after an API push call).

current events.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name='sales_order_save_after'>
        <observer name='vendor_autoinvoice_send_invoice' instance='Vendor\AutoInvoice\Model\Observer\AutoInvoice'/>
  • Similar answer you are lookig for is at magento.stackexchange.com/questions/125058/… . It may help you. – Kamal Singh Jan 1 '18 at 7:19
  • I was aware of these but they are all related to order state changes, not order status. – Ultrazeus Jan 1 '18 at 12:59
  • 1
    Magento 2 is strict with state. And all status types follow state. Here you can check for status value as per need. – Kamal Singh Jan 1 '18 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.