Magento Forum

   
Category menu at product page
 
pboogaard
Jr. Member
 
Total Posts:  2
Joined:  2012-03-13
 

How do I add the category menu to the left side of the product page? For example:
http://www.wehkamp.nl/beeld-geluid/televisies/FB4/722516/C26_6F1_FB4_722516/

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagikSwapna
Sr. Member
 
Total Posts:  97
Joined:  2010-12-14
 

Hello,

To add category menu at left side add following code under catalog.xml file
<reference name="left">
<block type="catalog/navigation" name="catalog.left_nav" before="-" template="catalog/navigation/left_nav.phtml"/>
</reference>

 
Magento Community Magento Community
Magento Community
Magento Community
 
code2012
Member
 
Total Posts:  37
Joined:  2012-09-17
 

<?php
$obj = new Mage_Catalog_Block_Navigation();
$store_cats = $obj->getStoreCategories();
$current_cat = $obj->getCurrentCategory();
$current_cat = (is_object($current_cat) ? $current_cat->getName() : '');?>
<?php foreach ($store_cats as $cat)
{ if ($cat->getName() == $current_cat) {
echo '<li style="padding-left:5px;">
<a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."
</a>n<ul>n";
foreach ($obj->getCurrentChildCategories() as $subcat)
{ echo '<li style="padding-left:15px;">
<a href="'.$this->getCategoryUrl($subcat).'">'.$subcat->getName()."</a>
</li>n"; }
echo "</ul>n</li>n"; }
else
{ echo '<li><a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."
</a></li>n"; }}

?>

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