Guest User

Untitled

a guest
Dec 17th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. <reference name="left">
  2. <block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/my_left_nav.phtml" />
  3. </refrence>
  4.  
  5. <!-- List all categories and their second level subcategories -->
  6. <div class="block block-list block-categories">
  7. <div id="block-categories" class="block-title active">
  8. <strong><span>Categories </span></strong>
  9. </div>
  10.  
  11. <div id="leftnav" class="block-content" style="display:block">
  12. <?php $helper = $this->helper('catalog/category') ?>
  13. <?php $categories = $this->getStoreCategories() ?>
  14. <?php if (count($categories) > 0): ?>
  15. <ul id="leftnav-tree" class="level0">
  16. <?php foreach($categories as $category): ?>
  17. <li class="level0<?php if ($this->isCategoryActive($category)): ?> active<?php endif; ?>">
  18. <a href="<?php echo $helper->getCategoryUrl($category) ?>"><span><?php echo $this->escapeHtml($category->getName()) ?></span></a>
  19. <?php //if ($this->isCategoryActive($category)): ?>
  20. <?php $subcategories = $category->getChildren() ?>
  21. <?php if (count($subcategories) > 0): ?>
  22. <ul id="leftnav-tree-<?php echo $category->getId() ?>" class="level1">
  23. <?php foreach($subcategories as $subcategory): ?>
  24. <li class="level1<?php if ($this->isCategoryActive($subcategory)): ?> active<?php endif; ?>">
  25. <a href="<?php echo $helper->getCategoryUrl($subcategory) ?>"><?php echo $this->escapeHtml(trim($subcategory->getName(), '- ')) ?></a>
  26. <?php $secondLevelSubcategories = $subcategory->getChildren() ?>
  27. <?php if (count($secondLevelSubcategories ) > 0): ?>
  28. <ul id="leftnav-tree-<?php echo $subcategory->getId() ?>" class="level2">
  29. <?php foreach($secondLevelSubcategories as $secondLevelSubcategory ): ?>
  30. <li class="level2<?php if ($this->isCategoryActive($secondLevelSubcategory )): ?> active<?php endif; ?>">
  31. <a href="<?php echo $helper->getCategoryUrl($secondLevelSubcategory ) ?>"><?php echo $this->escapeHtml(trim($secondLevelSubcategory ->getName(), '- ')) ?></a>
  32. </li>
  33. <?php endforeach; ?>
  34. </ul>
  35. <script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script>
  36. <?php endif; ?>
  37. <?php endforeach; ?>
  38. </ul>
  39. <script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script>
  40. <?php endif; ?>
  41. <?php //endif; ?>
  42. </li>
  43. <?php endforeach; ?>
  44. </ul>
  45. <script type="text/javascript">decorateList('leftnav-tree', 'recursive')</script>
  46. <?php endif; ?>
  47. </div>
  48. </div>
Add Comment
Please, Sign In to add comment