0

I have created a custom module that executes a function when an order is canceled. I am using order_cancel_after event to do this and it works most of the times, but not always.

There's a payment extension, which code is encrypted. When an order is canceled by this payment extension, the order_cancel_after event function is not executed. Possible ways that the order is canceled are the following:

$order->registerCancellation();

$order->cancel()->save();

$order->setStatus(Mage_Sales_Model_Order::STATE_CANCELED)->addStatusHistoryComment($orderComment)->save();

Is there any other event I could use? Is order_cancel_after a safe way to track order cancelation?

2

You can rather observer event sales_order_save_after and check for

if ($observer->getOrder()->isCanceled()) {
           //Your code 
        }
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.