Pages

Wednesday, 12 November 2014

Magento subcategory from a particular category

<?php
    $_categoryModel = new Mage_Catalog_Model_Category();
    
    $_subCategoryList = $_categoryModel->load(3)->getChildrenCategories();
    
    foreach ($_subCategoryList as $category)
    {
        $cat=$_categoryModel->load($category->getId());
?>
        <li><div><img src="<?php echo Mage::getBaseUrl('media').'catalog/category/'.$cat->getImage()?>"/><a href="#"><?php echo $cat->getName()?></a></div></li>
<?php
        print_r($category);
    }
?>

No comments:

Post a Comment