I want to influence product rendering (passing $params to Mage_Catalog_Helper_Product_View::prepareAndRender()) and registered an observer on the controller_action_predispatch_catalog_product_viewevent.
rendering is working fine, but the original catalog/product/view action is still executed and so two products are displayed.
How can I stop the dispatching during the pre-dispatch observer?
dispatched field of the request has to be trueFLAG_NO_DISPATCH flag of the front action has to be set to trueIn code (inside observer):
// @see Mage_Core_Controller_Varien_Action::dispatch()
$controller = $observer->getControllerAction();
$controller->getRequest()->setDispatched(true);
$controller->setFlag(
'',
Mage_Core_Controller_Front_Action::FLAG_NO_DISPATCH,
true
);
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