7

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.

4

1 回答 1

20

controller_action_predispatch_checkout_onepage_index应该是您要查找的事件。所有控制器都继承了 preDispatch 方法,该方法会为 predispatch 触发一个通用事件,以及基于请求的操作路径的特定事件。您想要的控制器位于模块中,并使用默认操作checkout调用。onepageindex

查看Mage_Core_Controller_Varien_Action::preDispatch()相关代码

于 2012-06-26T21:59:03.887 回答