<?php
$_helper = Mage::helper('catalog/category')
$_categories = $_helper->getStoreCategories()
$currentCategory = Mage::registry('current_category')
if (count($_categories) > 0):
foreach($_categories as $_category):
echo $_category->getId();
echo $_category->getName();
$_category = Mage::getModel('catalog/category')->load($_category->getId())
$_subcategories = $_category->getChildrenCategories()
if (count($_subcategories) > 0):
foreach($_subcategories as $_subcategory):
echo $_subcategory->getId();
echo $_subcategory->getName();
foreach (Mage::getModel('catalog/category')->load( $_subcategory->getId())->getChildrenCategories() as $childCategory)
{
echo $childCategory->getId();
echo $childCategory->getName();
}
endforeach;
endif;
endforeach;
endif; ?>
No comments:
Post a Comment