Archive for January 2014

Magento:Cash On Delivery activated only for Admin Only

There are many ways to activated Cash On Delivery  only for admin . I would discourage using Observer events hide it from the end user.

I also suggest not override core files (even if you are not editing them), as that will cause upgrade problems in the future.

you can create your  custom module like below :












Remark : You can change “Namespace” as per your need.


Add Custom message using magento

How to add Custom Success message and add Error message in Magento Session 

You can add any custom Error message or Success message in magento session .If you are thinking to show an error message or success message one time when a page load then it is the best method to use in mganeto session .


Success message

Set success message for front page :

Set success message for admin page :



If you are unable to view the error/success message, add the function session_write_close() after setting message. I got such problem while using with redirect method.

Now the new snippet will look like below,


Notice Message

By this way we can show notice message by using addNotice().




Error message

Set error message for front page :



Set error message for admin page.