Magento – Category Descriptions & Images

Photo of author
Written By Ryan Rana





I hate it when you spend time trying to get something to work – then realised that you’ve already solved this same problem before and really should have remembered. Must blog more!!

Anyway this one relates to Magento Category descriptions and images. Using the method

echo $_category->getDescription()

Won’t work unless you amended the Mage_Catalog_Block_Navigation class. Take a local copy of Mage/Catalog/Block/Navigation.php and ensure that the getCurrentChildCategories() method works like below. Note there’s an interesting point on Stackoverflow about removing the load() call prior to returning it.

public function getCurrentChildCategories()
        $layer = Mage::getSingleton('catalog/layer');
        $category   = $layer->getCurrentCategory();
        /* @var $category Mage_Catalog_Model_Category */
        $collection = Mage::getModel('catalog/category')->getCollection();
        /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
            ->addAttributeToFilter('is_active', 1)
            ->setOrder('position', 'ASC')

        $productCollection = Mage::getResourceModel('catalog/product_collection');
        return $collection;

Leave a Comment