I can get a list of the children categories for a specific category with the following code:
public function displaycats($data, $begin,$end, $catid){
$currentCat = Mage::getModel('catalog/category')->load($data[0]);
$children = explode(",",$currentCat->getChildren());
foreach ($children as $child) {
$cot++;
$subCat = Mage::getModel('catalog/category')->load($child);
if ($cot >= $begin && $cot <= $end){
echo '<a href="'.$subCat->getUrl().'?stockable=786">'.$subCat->getName()."</a><br>";
}
}
return;
}
The problem is that the list is not ordered the same as Magento has the categories ordered in the admin area. Can anyone help me out?