Observer to check

Is there an observer in Magento to detect the start of the checkout process? This includes hitting the page checkout/onepage/

or checkout/onestepcheckout/

. I would like to avoid exceeding the checkers if possible.

+3


source to share


3 answers


Each controller action will result in multiple target events that are fired in the Mage_Core_Controller_Varien_Action

(link)
superclass for all action controllers. These events variously include the "fully qualified action name" derived from the router module configuration + controller path + action, as well as the requested route name.

In the case of a standard one-page check, the full name of the action checkout_onepage_index

and the name of the route checkout_onepage

.

renderLayout ():

controller_action_layout_render_before_'.$this->getFullActionName()

preDispatch ():



controller_action_predispatch_' . $this->getRequest()->getRouteName()

controller_action_predispatch_' . $this->getFullActionName()

postDispatch ():

controller_action_postdispatch_' . $this->getRequest()->getRouteName()

controller_action_postdispatch_' . $this->getFullActionName()

What events you observe will depend on how the OneStepCheckout module captures the routes. Events based on getRouteName()

can be useful if you need to distinguish between routes and modules. You want to test the client logged in and client logged out scenarios. While pre-sorting events are preferred for logic that involves redirection, you will want to balance your needs versus duplicate cart / quote + customer logic logic.

+8


source


Have a look @ controller_action_predispatch_checkout_onepage_index

event



See "Go to Checkout" for Magento?

+4


source


Why do you want to do it so late? Depending on what you are checking, can you do this after adding them to your cart?checkout_cart_save_before

+1


source







All Articles