How To Get Current Order Status And New Order Status In Magento 2

in magento •  2 years ago 

The crazily adaptable Magento 2 platform enables us, as developers, to meet the demanding client demands!

Is it not?

2How-To-Get-Current-Order-Status-And-New-Order-Status-In-Magento-2-Social-Share.png

The client wanted to do a particular action when the order status changed, and I recently encountered a situation similar to this. I needed to retrieve the most recent order status and the old order status in Magento 2.

I immediately put that solution in this blog so that the developers wouldn't have to go through what I did to find the answer.

The code provided below can be used to add features such as those that notify customers to utilize a coupon code when their order status changes from place to processing or that compute and refund tax when an order is placed and completed.

To take any action when the order status changes in Magento 2, get the prior and subsequent order status using the shared code.

Visit: https://meetanshi.com/blog/get-current-order-status-and-new-order-status-in-magento-2/

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!