search
top

Get child categories in Magento

Hello All,

I am writing here a script for getting all the child categories of the required category id


<?php	

	$category_model = Mage::getModel('catalog/category'); //get category model

	$_category = $category_model->load($categoryid); //$categoryid for which the child categories to be found       	

        $all_child_categories = $category_model->getResource()->getAllChildren($_category); //array consisting of all child categories id

?>

Hope this is useful



3 Responses to “Get child categories in Magento”

  1. fox says:

    thanks a lot!

  2. bingo says:

    thanks !

Leave a Reply

top