php - Observer Cancel order Magento -


Hello I'm trying to add functionality when I am canceling order in Magento. My config is working and when I cancel an order, my function is triggered, but I do not get the order sent to the supervisor. Here is the initial code of my class.

 < Code> class Imo_Model_Observer {static function export order ($ inspector) {$ command = $ inspector- & gt; GetData ('entity_id'); Self :: createFile ($ command, 'complete'); // resonance "start export"; }   

In this case I have canceled it but with no luck, I have tried to get the entity_id in order to get the full order < / P>

To cancel an order means that the order is actually set to "cancel" so that you have an event You should follow Sales_order_save_after and get the order object from the event, check who was the previous state and your own place End Set

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -