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

Menu verticale con solo subcategorie
 
melone
Jr. Member
 
Total Posts:  3
Joined:  2008-09-30
 

dunque uso il tutorial vert_nav, ma vorrei che si vedessero solo le sub categorie di quella selezionata. mi spiego meglio

allora nel menu orrizzonatale mi ritrovo “piatti, posate, bicchieri” sono quelle macro…
ora se seleziono piatti, il vert_nav mi fa vedere comunque anche posate e bicchieri…

io vorrei che si vedessero solo le sotto categorie di piatti, come posso modificare il codice??

vertnav.phtml

<div class="box layered-nav">
    <
div class="head">
        <
h3><?php echo $this->__('Browse By'?></h3>
    </
div>
    <
div class="content">
        <
div class="narrow-by">
    <
div id="vertical-nav">
        <
ul id="nav_vert">
                    
<?php foreach ($this->getStoreCategories() as $_category): ?>
           
            <?php $open 
$this->isCategoryActive($_category); ?>
            <?php $potential 
$_category->hasChildren(); ?>
            
<li><a href="<?php echo $this->getCategoryUrl($_category); ?>"<?php if($openecho ' class="open"'} ?><?php if($potentialecho ' class="potential"'} ?> ><?php echo $_category->getName();?></a>
                
<?php if ($open && $potential): ?>
                
<ul>
                    
<?php foreach ($_category->getChildren() as $subcategory): ?>
                    <?php $subCat 
Mage::getModel('catalog/category')->load($subcategory); ?>
                    <?php $open 
$this->isCategoryActive($subCat); ?>
                    <?php $potential 
$subCat->hasChildren(); ?>
                    
<li><a href="<?php echo $this->getCategoryUrl($subCat); ?>"<?php if($openecho ' class="subopen"'} ?><?php if($potentialecho ' class="potential"'} ?><?php if(!$potential&&$openecho ' class="final"'} ?> ><?php echo $subCat->getName(); ?></a>
                        
<?php if ($open && $potential): ?>
                        
<ul>
                            
<?php foreach ($subcategory->getChildren() as $subsubcategory): ?>
                            <?php $subsubCat 
Mage::getModel('catalog/category')->load($subsubcategory); ?>
                            <?php $open 
$this->isCategoryActive($subsubCat?>
                            
<li><a href="<?php echo $this->getCategoryUrl($subsubCat); ?>" <?php if($openecho ' class="final"'} ?>><?php echo $subsubCat->getName(); ?></a></li>
                            
<?php endforeach; ?>
                        
</ul>
                        
<?php endif; ?>
                    
</li>
                    
<?php endforeach; ?>
                
</ul>
                
<?php endif; ?>
            
</li>
            <
li class="separator">&nbsp;</li>             
  
            
<?php endforeach ?>            
        
</ul>
    </
div>
            <
script type="text/javascript">decorateDataList('narrow-by-list')</script>
        
</div>
    </
div>
</
div>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top