Magento Forum

   
Add category listing to all sidebars and get parent category title? 
 
morticya33
Jr. Member
 
Total Posts:  6
Joined:  2009-01-03
 

Hey all,

I’ve been searching forums but to no luck, so point me to the right direction if you know a solution. smile

How do I actually get the parent category to display in my <h4> tag?

The code in app\design\frontend\default\blank\template\catalog\navigation\left.phtml :

<?php $_categories=$this->getCurrentChildCategories() ?>
<?php 
if($_categories->count()): ?>
<div class="category">
<
h4><?php echo $this->__('Category'?></h4>
<
ul>
    
<?php foreach ($_categories as $_category): ?>
    <?php 
if($_category->getIsActive()): ?>
    
<li>
        <
a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>>
        
<?php echo $this->htmlEscape($_category->getName()) ?>
        
</a>
        (
<?php echo $_category->getProductCount() ?>)
    </
li>
    
<?php endif; ?>
    <?php 
endforeach ?>
</ul>
<?php endif; ?>
</div>

Next, with left.phtml, what do I add onto all the xml files to get it to display on ALL the sidebars of my site (page, shopping cart, checkout)? Currently it’s displaying fine in Category and Product pages.

Thanks in advance!

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