I am using Magento 1.9.2.1 and attempted Dexxtz's solution. I found that not all the necessary information was present for me to continue. For example, the img Url returned nothing. In my case, I was building a custom navigation with category images.
After debugging using:
echo "<pre>"; var_dump(Zend_Debug::dump($subcategory->getData())); echo "</pre>"; die;
I found the image was not even being returned at all. In my case, I found that getCollection() better suited my needs:
$_cat = Mage::getModel('catalog/category')->load($id);
if (isset($_cat) && !empty($_cat) && is_object($_cat)) {
// Create category collection for children
$childrenCollection = $_cat->getCollection();
// Only get child categories of parent cat
$childrenCollection->addIdFilter($_cat->getChildren());
// Only get active categories
$childrenCollection->addAttributeToFilter('is_active', 1);
// Add base attributes
$childrenCollection->addAttributeToSelect('url_key')
->addAttributeToSelect('name')
->addAttributeToSelect('all_children')
->addAttributeToSelect('is_anchor')
->setOrder('position', Varien_Db_Select::SQL_ASC)
->joinUrlRewrite();
// Add Image
$childrenCollection->addAttributeToSelect('image');
if (count($childrenCollection) > 0) {
foreach($childrenCollection as $subcat) {
if ($subcat->getIsActive()) {
$subcatName = $subcat->getName();
// Rest of code here
}
}
}
}
Hope this helps others in my position.