1

I need to run some custom code after a successful order creation. I'll need to access each item in an order, both the quote item and subsequent order item. My first instinct was to use the following events:

  • sales_convert_quote_item_to_order_item
  • sales_order_item_save_after

However, when using the Authorize.net gateway, both of these events are dispatched when a transaction fails and no order is created! Is there a later event to use that would still allow access to quote items? Or, is there a way to test for a successful transaction within these two events?

Thanks!

2 Answers 2

1

You can try checkout_submit_all_after.

0

I've used sales_order_item_save_after and then checked for a pending status on the order like so:

$order = $observer->getEvent()->getOrder();
if($order->getStatus()=="processing"){
    //Your observer code
}

Then make sure that your authorize.net payment method is configured to set new orders to the processing status. This also works well for other payment methods like Purchase Orders.

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.