Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

how to get subcategory from curent category
 
miss_nn
Member
 
Total Posts:  31
Joined:  2009-03-24
 

hi all,,,

i want to get subcategory from current category.
i want too looping that subcategory..
anyone can help me?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
pidan
Jr. Member
 
Total Posts:  12
Joined:  2009-05-14
 

<?php $_categories=$this->getCurrentChildCategories() ?>
 
<?php 
if($_categories->count()): ?>
<ul class="category-links">  
    
<?php $_mediaBaseUrl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA?>
    <?php 
foreach ($_categories as $_category): ?>
        <?php 
if($_category->getIsActive()): ?>
        
<li class="<?php echo $this->htmlEscape($_category->getUrlKey()) ?>">
            
<?php $_categoryUrl=$this->getCategoryUrl($_category?>
            <?php $_categoryName
=$this->htmlEscape($_category->getName()) ?>
            
            <?php $_imageUrl
=$_category->getImageUrl() ?>
            <?php 
if(!$_imageUrl): ?>
                <?php $_imageUrl
=$_mediaBaseUrl '/catalog/category/category_image_default.gif' ?>
            <?php 
endif; ?>
            
<div class="categoryname_imagebox">
                <
a href="<?php echo $_categoryUrl ?>">
                    
<?php echo $_categoryName ?>
                
</a>
            </
div>
            <
a href="<?php echo $_categoryUrl ?>">
                <
img src="<?php echo $_imageUrl ?>" alt="<?php echo $_categoryName ?>" width="120px" height="120px" />
            </
a><br/>            
        </
li>
        
<?php endif; ?>
    <?php 
endforeach ?>

</ul>
<?php endif; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
VortexCommerce
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-08-06
Harrogate, UK
 

How would you go about showing the categories descriptions? Thanks in advanced.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top