magento: vertical navigation category with links


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. this code works for vertical navigation category�
  2.  
  3. <?php
  4.  
  5. /**
  6.  
  7.  * Top menu for store
  8.  
  9.  *
  10.  
  11.  * @see Mage_Catalog_Block_Navigation
  12.  
  13.  */
  14.  
  15. ?>
  16.  
  17.  
  18.  
  19. <div class=�box_mini_vert�>
  20.  
  21. <div id=�vertical-nav-container �>
  22.  
  23. <?php foreach ($this->getStoreCategories() as $_category): ?>
  24.  
  25. <?php foreach ($this->getCurrentChildCategories() as $_categories): ?>
  26.  
  27. /*in this line $_categories->getUrl() is present so you can get link of your categories*/
  28.  
  29. <ul class=�vert_left_list_style�>
  30.  
  31. <li><b><?php echo �<br/>� ?><a href=�<?php echo $_categories->getUrl() ?>�><?php echo $_categories->getName(); ?></a></b></li>
  32.  
  33. </ul>
  34.  
  35. <ul>
  36.  
  37. <?php foreach ($_categories->getChildren() as $childcategory):?>
  38.  
  39. <?php echo $this->drawItem($childcategory) ?>
  40.  
  41. <?php endforeach; ?>
  42.  
  43. </ul>
  44.  
  45. <?php endforeach; ?>
  46.  
  47. </div>
  48.  
  49. </div>

URL: http://freecoderesources.wordpress.com/2009/02/26/magento-vertical-navigation-category-with-links/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.