I had a main category (parent category) whose id = 10. I want to echo just its sub-categories. How can I do that?
To get all the active
as well as inactive
sub categories
$parent_category_id = 10;
$child_categories = Mage::getResourceModel('catalog/category_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('is_active', array('in' => array(0,1)))
->addAttributeToFilter('parent_id', $parent_category_id);
foreach ($child_categories as $cat)
{
$sub_category_id = $cat->getId();
$sub_category_name = $cat->getName();
}