Hello Friends,
You can set error and success message in magento through the following code
Mage::getSingleton('core/session')->addSuccess(Mage::helper('module_name')->__('Please Type Your Success Message'));
Mage::getSingleton('core/session')->addError(Mage::helper('module_name')->__('Please Type Your Error Message'));
Now Code for display error and success message on phtml
<div id="message">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
</div>
I hope this post helpful to all my needed friends...
Hi,
ReplyDeleteThis code "$this->getMessagesBlock()->getGroupedHtml()" is not showing error or success message using custom module. please share another code to get error or success message..
Thanks
did you set it in session because without set in session it will not display
DeleteThanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well.this was actually what i was looking for,and i am glad to came here!
ReplyDeletemagento development company in bangalore