Pages

Tuesday, June 25, 2013

Show subcategories on category page

<?php

$_helpernew = Mage::helper('catalog/category');
 $_subcategories = $_category->getChildrenCategories();?>
                <?php if (count($_subcategories) > 0): ?>
                    <ul>
                        <?php foreach($_subcategories as $_subcategory): ?>
                            <li>
                                <a href="<?php echo $_helpernew->getCategoryUrl($_subcategory) ?>">
                                    <?php echo $_subcategory->getName() ?>
                                </a>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                <?php
                                                               
endif;
                                                               

?>

No comments:

Post a Comment