0
        <?php $currentCat = Mage::registry('current_category');
            if ( $currentCat->getParentId() == Mage::app()->getStore()->getRootCategoryId() )
            {
                $loadCategory = $currentCat;
            }
            else
            {
                $loadCategory = Mage::getModel('catalog/category')->load($currentCat->getParentId());
            }    
            $subCategories = explode(',', $loadCategory->getChildren());

            foreach ( $subCategories as $subCategoryId )
            {
                $cat = Mage::getModel('catalog/category')->load($subCategoryId);

                if($cat->getIsActive())
                {
                    if ($currentCat->getEntityId() == $subCategoryId)
                    {
                        echo '<b>'.$cat->getName().'</b><br />';
                    }
                    else
                    {
                        echo '<a href="'.$cat->getURL().'">'.$cat->getName().'</a> ('.$cat->getProductCount().')<br />';
                    }
                }
            }
        ?>
4

0 回答 0