Redirect Magento with global messages

Open the controller that contains your logic, put these lines at terminate point of your code:


Mage::getSingleton('core/session')->addError('your message goes here');

$this->_redirect('redirect location');

return;

Above example will redirect and dispay an Error message, you can also display other type of message with the following methods from singleton Core/session

  • addWarning
  • addNotice
  • addSuccess

Leave a Comment