I have a scenario where I need to do some calculation on grand total.
- When order is placed successfully, fetch order status and do something
- After order is placed, and when order status is changed, fetch order status and do something more.
I am using the event
sales_order_place_after while for second one
The issue is for first case event
sales_order_place_after is working good and calculations are correct. But for second case, I am not able to fetch order status using
sales_order_save_after when order is being placed successfully.
Order status can be only retrieved when its changed from backend, while I need to get it
after order is placed and/or order is changed.
sales_order_save_after is a bit tricky. The first time it's triggered Order is not yet commited to DB, and more to that - it actually doesn't have State and Status set yet.
Am I using incorrect events in this case ?