0

I have an observer programmed for the checkout_onepage_controller_success_action and need to know the corresponding event that I should use if the user has onepage checkout off and is using the default.

        <checkout_onepage_controller_success_action>
            <observers>
                <myextension>
                    <type>model</type>
                    <class>myextension/observer</class>
                    <method>handlePurchaseEvent</method>
                </myextension>
            </observers>
        </checkout_onepage_controller_success_action>

This event doesn't fire on success of the normal 5-step checkout flow.

Thanks for advice.

1 Answer 1

0

You should use checkout_submit_all_after. This is dispatched in the following:

  • Mage_Checkout_Model_Cart_Api::createOrder()
  • Mage_Adminhtml_Model_Sales_Order_Create::createOrder()
  • Mage_Checkout_Model_Type_Multishipping::createOrders()
  • Mage_Checkout_Model_Type_Onepage::saveOrder()

If you're using a custom checkout extension, I'd assume that it would also dispatch this event.

It is dispatched after the quote has been converted into an order via Mage_Sales_Model_Service_Quote::submitOrder, payment charged etc, so if the event is dispatched you can rely on the checkout having been completed successfully.

1
  • So I should use checkout_submit_all_after instead of what I have then? Thanks!
    – phpguru
    Jun 9, 2016 at 14:34

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.