Magento: Show Success, Error or notice message

Share
Posted on April 7th, 2013 | Posted by admin

If you want to show a success message or an error message in your custom module or in anything else in magento, we can use the addSuccess() and addError() functions. These functions show the respective messages in the magento format. You don’t have to build a seperate markup for you custom module messages you can use the magento default html for showing messages using the 2 functions.

Showing messages on the frontend

$message = 'Your message ... ';
Mage::getSingleton('core/session')->addError($message);
Mage::getSingleton('core/session')->addSuccess($message);

Show Magento form validation error messages in a tooltip

Share
Posted on October 16th, 2012 | Posted by admin

Here is a quick tip how to enhance your form validation error messages and show them in a tooltip.

There’s no need for any templates modification, all you have to do is edit your CSS file and update it with custom code.

Here is a short video demonstrating how does it work.

When error message is triggered, Magento injects div with the class “validation-advice”. This is the class we have to  edit in CSS file.
It has to be positioned absolutely relative to it’s container, which is input-box.
So, find the class .validation-advice in your styles.css file ( it is located around line 300 ), and replace it with:

Taming magento errors display

Share
Posted on April 27th, 2011 | Posted by admin

Murphy says: “Anything that can go wrong, will go wrong”. When it happens to your store it’s best to get the information about it ASAP and present the error in the most humane possible way. Let’s do it!

Since ever Magento presented it’s errors on the front-end for everyone to see and it was good for the developers but once the site has gone live that couldn’t be an option anymore. In Magento 1.4 those errors are now hidden and all your customer could get about the actual error was the “error number”.

There has been an error processing your request.

Share
Posted on April 12th, 2011 | Posted by admin

Are you sick and tired of scrolling you browser when you get Magento error, trying to read and trace it?

Here is a post of my colleague Ivan Weiler which describes how to enable error information in latest Magento.

This is a screenshot of my browser when I get Magento error:

New maintenance and error features

Share
Posted on April 4th, 2011 | Posted by admin

New Magento 1.4 brings changes in how errors are displayed along with an easy way to put your favorite store into maintenance mode.

If you check index.php file of new Magento 1.4, you’ll notice one interesting thingy, it checks for existence of “maintenance.flag” file in store root, if it’s found your store is put into maintenance mode. Service Temporarily Unavailable page is displayed with Please try again later message. Remember that administration can’t be accessed in maintenance mode along with the store.

Developers probably noticed that errors also are no longer displayed like before, as mentioned on Magento blog:
Since version 1.4.0.0 for security reasons the trace in the Magento error report page is disabled by default. The “Error log number” does not give any information about the error. To enable the trace copy the errors/local.xml.sample to errors/local.xml and follow the instructions described in that file.

Page 1 of 212»