Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Proceed to Checkout' Event for Magento?

Tags:

magento

I've just started putting together a Magento module which bypasses the whole Magento checkout process and instead sends the cart details to a 3rd party fulfilment company via XML-RPC.

Not getting anywhere fast and could use a bit of guidance. My understanding is that I should create the module with an observer based on the event triggered by proceeding to checkout. Trouble is I can't work out which event that would be, I've been through the whole massive list here;

http://www.nicksays.co.uk/magento_events_cheat_sheet/

I've tried;

checkout_submit_all_after - fires after order processed successfully

checkout_cart_add_product_complete - fires after product added to cart

checkout_cart_save_before - fires after product added to cart

checkout_type_onepage_save_order - can't get this to fire at all

checkout_onepage_controller_success_action - fires after order processed successfully

I don't know if this means I'll have to create a custom event or if there is an entirely different and much better alternative to what I'm doing. Building and sending the XML I will leave to another question (starting to realise I may have my hands pretty full here) but any tips there gratefully appreciated too.

Thanks for any help.

like image 313
McNab Avatar asked Jun 26 '12 15:06

McNab


People also ask

How does Magento checkout work?

The checkout in Magento Commerce is built up from a series of Knockout JS components which are then rendered using the Knockout JS templating system. Magneto 2 defines each one of these components and their parent / child relationship in a large XML file which can be extended or overridden in your own theme or module.

What is checkout session in Magento 2?

Magento\Checkout\Model\Session– Checkout session is used to store checkout related information. Magento\Customer\Model\Session– Customer session is used for customer, frontend login and all other activities. Magento\Newsletter\Model\Session– For newsletter data.

What is checkout page in Magento?

The Checkout page leads the customer through 2 easy steps of the process. Customers who are logged into their accounts can complete checkout quickly, because much of the information is already in their accounts.


1 Answers

controller_action_predispatch_checkout_onepage_index should be the event you're looking for. All controllers inherit the preDispatch method which fires a generic event for predispatch, and a specific event based on the requested action path. The controller you want lives in the checkout module and is called onepage with a default action of index.

Review Mage_Core_Controller_Varien_Action::preDispatch() to see the relevant code

like image 108
Jonathan Day Avatar answered Sep 21 '22 09:09

Jonathan Day