Created
February 26, 2015 13:33
-
-
Save fourroses666/5c45a4bd9db40276216c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="block left-categorys"> | |
<?php | |
$currentCat = Mage::registry('current_category'); | |
echo '<div class="block-title"><h2>'.$currentCat->getName().'</h2></div>'; | |
$collection = Mage::getResourceModel('catalog/category_collection') | |
->addAttributeToFilter('parent_id', $currentCat->getId()) | |
->addAttributeToFilter('is_active', 1) | |
->addAttributeToSort('position', 'asc') | |
->addAttributeToSelect('name') | |
->addUrlRewriteToResult(); | |
if($collection->getSize()){ | |
echo '<div class="block-content left-categorys-container">'; | |
foreach ($collection as $category ){ | |
echo '<a href="'.$category->getUrl($category).'">'.$category->getName().'</a>'; | |
} | |
echo '</div>'; | |
} | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment