Hello all now you can sort category and its sub-categories in alphabetically order without changes in core file.
copy and past following code in any phtml file.
<?php
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
$catIds = explode(',', $cats);
$categories = array();
$subCategories = array();
foreach ($catIds as $catId) {
$category = Mage::getModel('catalog/category')->load($catId);
$categories[$category->getName()] = $category->getUrl();
$subcats = Mage::getModel('catalog/category')->load($catId)->getChildren();
$subcatIds = explode(',', $subcats);
if ($subcats) {
foreach ($subcatIds as $subcatId) {
$subCategory = Mage::getModel('catalog/category')->load($subcatId);
$subCategories[$category->getName()][$subCategory->getName()] = $subCategory->getUrl();
}
ksort($subCategories[$category->getName()], SORT_STRING);
}
}
ksort($categories, SORT_STRING);
?>
<div id="leftmenu" class="block block-nav">
<div class="block-title"><strong><span>Kunstnerartikler</span></strong></div>
<div class="block-content">
<ul>
<?php foreach ($categories as $name => $url): ?>
<li>
<?php $_category = Mage::getModel('catalog/category')->loadByAttribute('name',$name); ?>
<?php if($_category->getChildren()) { ?>
<div class="navhead"><p class="cursor"><?php echo $name; ?> </div>
<?php } else { ?>
<div class="navhead2"><p>
<a href="<?php echo $url; ?>"><?php echo $name; ?></a>
</p>
</div>
<?php } ?>
<?php foreach ($subCategories as $key => $values) { if($name == $key) { echo ''; ?>
<div class="navcontent">
<ul>
<?php foreach($values as $subName => $subUrl) { ?>
<li class="menusub lige"><strong>•
<a href="<?php echo $subUrl ?>" >
<?php echo $subName; ?>
</a>
</strong>
</li>
<?php }
?> </ul>
</div> <?php
echo ""; } } ?>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>