Observer to check
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.
source to share