3

Is there any reason checkout_onepage_controller_success_action event is dispatched after the layout is loaded. Here is an extract from Mage_Checkout_OnepageController::successAction:

    $session->clear();
    $this->loadLayout();
    $this->_initLayoutMessages('checkout/session');
    Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
    $this->renderLayout();
3

I would say to do things after the rendering (and after sending away the response?)

If you want to do things before rendering, just use:

\Mage_Core_Controller_Varien_Action::renderLayout
app/code/core/Mage/Core/Controller/Varien/Action.php:385
Mage::dispatchEvent('controller_action_layout_render_before_'.$this->getFullActionName());
  • Sorry, meant not "rendering" but "loading". Sure I can even use controller pre dispatching, but WHY? – user487772 May 22 '14 at 14:25
3

The only observer I can find for this event is from the Google Analystics module, which manipulates the layout.

So if we had no loaded layout -> GA module could not manipulate the layout.

Now we can discuss about if that is the best way to implement a change like that, but that might have been a effort/value decision. ;)

1

Apart from in the check out the only other place that I can see such behaviour is with the event sendfriend_product.

But this seems to be only used to report that the event has been fired...unless I am reading the code wrong.

It ends up writing to the reports/event with all the information from the event itself, though I am not sure why this would need to be done at this point.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.