Tips in Magento

Debugging Tips:

1. In your .htaccess, add

SetEnv MAGE_IS_DEVELOPER_MODE

2. Under system -> configuration -> advanced -> developer,

change current configuration scope dropdown on top left to main website, then debug -> turn template hints and block name hints to on.

3. We can log errors easily.

Mage::log($var);

4. To display popup errors,

Mage::throwException(“Your debug message here”);

5. To see a list of all events (useful when create events/observers in config.xml)

cd /app/code/core/Mage
grep -r -i Mage::dispatchEvent * 

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.