I created an Observer that makes some execution based on the company needs using event sales_order_shipment_save_after
. It does everything I need except changing the order status to a specific.
I both using Magento setState/setStatus
and running an SQL update script directly, but none won´t make the change.
I looked for running a plugin instead of the observer but I could not find where should the plugin fit.
It´s important to let you know that the state is the same as the one set by shipment - complete. Only the status needs to be updated.
$orderState = Order::STATE_COMPLETE;
$order2 = $objectManager->create('\Magento\Sales\Model\Order')->load($order_id);
$order2->setState($orderState)->setStatus("entregue_transportadora");
$order2->save();
Anyone can help me ?
Thanks !!
entregue_transportadora
status is set tocomplete
state. Verify from Stores -> Settings -> Order Status