I have actual the follow code:
Code:
<?php
$parentCategory = Mage::getModel('catalog/category')->load(3);
$subcategoryCollection = Mage::getModel('catalog/category')
->getCollection()
->addFieldToFilter('level', ['lteq' => $parentCategory->getLevel() + 2])
/*->addFieldToFilter('level', $parentCategory->getLevel() + 1)*/
->addFieldToFilter('path', ['like' => $parentCategory->getData('path') . '%'])
->addAttributeToSelect(['name'])
->setOrder('name', Varien_Data_Collection_Db::SORT_ORDER_ASC);
foreach ($subcategoryCollection as $category): ?>
<a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?></a>
<?php endforeach; ?>
And I like to have a sorted list, sorted like this (see
http://www.outdoorequipped.com/info/our_brands )
A
Adidas Altra
B
Body Glove
D
Dakine etc
I also have the issue, I not need to have the category "Brands" and "View all Brands" in the list.
See the actual list I have:
https://mag.outdoorequipped.com/allbrands
Bookmarks