Magento Forum

   
Subcategory not translate in front page
 
naujasdizainas
Sr. Member
 
Avatar
Total Posts:  128
Joined:  2007-11-04
Lithuania, Vilnius
 

I am using this

<div class="vertical-nav-container box base-mini">
    <
div id="vertical-nav">
        <
div class="head">
            <
h4><?php echo $this->__('Categories'?></h4>
        </
div>
        <
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 if($potential&&$openecho ''elseif($potentialecho ''}else{ echo ''}?><?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 if($potential&&$openecho ''elseif($potentialecho ''}?><?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>
            
<?php endforeach ?>
        
</ul>
    </
div>
</
div>

But subcategry not translate in front page.
Can help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
naujasdizainas
Sr. Member
 
Avatar
Total Posts:  128
Joined:  2007-11-04
Lithuania, Vilnius
 

I change $subCat to $subcategory and work

<div class="vertical-nav-container box base-mini">
    <
div id="vertical-nav">
        <
div class="head">
            <
h4><?php echo $this->__('Categories'?></h4>
        </
div>
        <
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 if($potential&&$openecho ''elseif($potentialecho ''}else{ echo ''}?><?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($subcategory); ?>
                    <?php $potential 
$subcategory->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 if($potential&&$openecho ''elseif($potentialecho ''}?><?php echo $subcategory->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>
            
<?php endforeach ?>
        
</ul>
    </
div>
</
div>

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