In magento2 back end when I submit shipment the order status will changes from processing to complete but I can’t find where the code execute this
can any one tell me where I can find the code?
I use magento2.4.3-p1
I found the code in "vendor/magento/module-sales/Model/Order/Shipment.php" when execute this method “_saveShipment” the status will changel,but I don’t know why.
2
Answers
In "MagentoSalesModelResourceModelOrder" there is a function Save(). Within the function you can retrieve and modify value of ‘status’ of Order.
Writing a plugin is preferable.
di.xml
PluginName.php
It’s in MagentoSalesModelResourceModelOrderHandlerState which is called whenever the Order is saved.