You are viewing an old revision of this post, from June 28, 2016 @ 19:30:49. See below for differences between this version and the current revision.

Magento – Set and unset system messages

You can use this code to clear error message 

Mage::getSingleton('core/session')->getMessages(true); // The true is for clearing them after loading them

You can use the following code show the Magento message

//A Success Message
Mage::getSingleton('core/session')->addSuccess("Some success message");

//A Error Message
Mage::getSingleton('core/session')->addError("Some error message");

//A Info Message (See link below)
Mage::getSingleton('core/session')->addNotice("This is just a FYI message...");

//These lines are required to get it to work
session_write_close(); //THIS LINE IS VERY IMPORTANT!

Revisions

  • June 28, 2016 @ 19:30:49 [Current Revision] by admin
  • June 28, 2016 @ 19:30:49 by admin

Revision Differences

There are no differences between the June 28, 2016 @ 19:30:49 revision and the current revision. (Maybe only post meta information was changed.)

No comments yet.

Leave a Reply