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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With