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 * 
Like it.? Share it:
Tags:

Comments are closed.