Best Practices for Magento Development

Worth taking a look:

The recording of the highly attended kick off of the new Magento Developer Solutions series of webinars is now available on the Magento Webinar Archive. Be sure to check out recordings of our other great webinars as well, all on the Magento Webinar Archive

Source: http://www.magentocommerce.com/blog/comments/now-available-best-practices-for-magento-development-in-the-webinar-archive/

Error on EAV Entity Abstract

If you get an error like this:

with message ‘Warning: Invalid argument supplied for foreach()  in /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line ...


try using this code

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

How to get current URL on phtml files

Simple tip where you will get the code to “extract” current Magento url from a template file.

Here is the code.

You can use it on any phtml file.

$this->helper('core/url')->getCurrentUrl() 


Behind the scenes, this calls a helper method and retrieves the current url.

You can also use this on any file by changing it to this code:

Mage::helper('core/url')->getCurrentUrl()