Add session message manually

December 30, 2010 16:31

Sometimes it doesn’t work when using the following codes to show the successful / error message:

$this->getMessagesBlock()->getGroupedHtml();

Doesn’t matter, you can use the below codes to show the successful / error message:

Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customform/session')->getMessages(true));
echo Mage::app()->getLayout()->getMessagesBlock()->getGroupedHtml();

That’s easy, right?

Happy Magento’ing ~

Share

Comments are closed.