0

I'm trying to get an Event after canceling Order now for COD or Pending Orders order_cancel_after Event is working fine but for Online Payment or Processing Orders same Event is not working I've tried sales_order_payment_cancel_invoice Event but same that event didnt work.. Now I want to know which Event Triggers on canceling Processing Order. Thanks

2 Answers 2

1

As i've seen there's multiple events for the order cancel,

  1. order_cancel_after
  2. sales_order_invoice_cancel
  3. sales_order_payment_cancel_invoice
  4. sales_order_payment_cancel_creditmemo
  5. sales_order_payment_cancel_invoice
  6. sales_order_creditmemo_cancel

If none of those fits you i think you should use the sales_order_save_after event, and check if the new order status differs from the old order status and then do your business logic,

sales_order_save_after and sales_order_state_change_before

on those 2 event's you can go check the new status of the order.

1
  • sales_order_save_after worked for me
    – Asad Khan
    Commented Aug 17, 2021 at 13:59
1

There's this one event: sales_order_save_after, it triggers a lot!

You can add restriction to your observer to prevent it running too many times (such as check if status is cancel)

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.