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:




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

1 Answer 1


You can rather observer event sales_order_save_after and check for

if ($observer->getOrder()->isCanceled()) {
           //Your code 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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