Use the observer "sales_order_save_commit_after" or "sales_order_invoice_pay " then you can get the order status and depending on the ...
class [Namespace]_[Module]_Model_Observer { public function orderExport( Varien_Event_Observer $observer) { $_event = $observer-> ...
Using events and observers, you can run your custom code in
You have to use event sales_order_save_after for your query. In observer, you can get the state of order using condition complete, public function ...
magento 2 order status change event & sales_order_save_after observer. Create a file events.xml in app/code/[Namspace]/[Module_Name]/etc
You can try the event. checkout_submit_all_after. It runs after order is submited successfully (and in back-end when you created an order too). For example, in ...
Observers are capable of modifying the behavior of a Magento
use Magento\ Framework\Event\ObserverInterface;
How to Get Order Status in sales order place after event Magento 2
Automatically invoice/ship/complete order in Magento. By: Branko Ajzele