Skip to content

Instantly share code, notes, and snippets.

@wsagen
Created January 29, 2014 05:00
Show Gist options
  • Select an option

  • Save wsagen/8682087 to your computer and use it in GitHub Desktop.

Select an option

Save wsagen/8682087 to your computer and use it in GitHub Desktop.
Redirect controller action (e.g. within observer predispatch)
public function yourMethod($observer)
{
if ($condition) {
$request = Mage::app()->getRequest();
$request->initForward()
->setControllerName('controllername')
->setModuleName('modulename')
->setActionName('actionname')
->setDispatched(false);
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment