Skip to content

Magento: Get Sub Category List

Display sub category list with name/title & url:

$catID = 33;
$datas = array();
$children = Mage::getModel(‘catalog/category’)->load($catID)->getChildren();
$children = explode(“,”,$children);
foreach ($children as $category) {
//echo $category->getName();
$mod = Mage::getModel(‘catalog/category’)->load($category);
$datas[] = array(
“id”=>$category,
“name”=>$mod->getName(),
“url”=>$mod->getUrl(),

);
}

print_r($datas);

 

Share

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *