- <?php
- $currentPath = $this->getCurrentPath();
- $currentCategory = Mage::registry('current_category');
- ?>
- <script type="text/Javascript">
- jQuery(document).ready(function(){
- $(".childnav").appendTo(".catalognav");
- });
- </script>
- <ul class="catalognav">
- <?php foreach ($this->getCategories() as $category): ?>
- <li>
- <a<?php if ($currentCategory->getId() == $category->getId()): ?> class="selected" <?php endif ?> href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?></a>
- </li>
- <li><span>/</span></li>
- <?php if ($currentCategory->getId() == $category->getId() || in_array($category->getId(), $currentPath)): ?>
- <ul class="childnav">
- <?php foreach ($this->getSubcategories($category->getId()) as $subcategory): ?>
- <li><a<?php if ($currentCategory->getId() == $subcategory->getId()): ?> class="selected" <?php endif ?> href="<?php echo $subcategory->getUrl() ?>"><?php echo $subcategory->getName() ?></a></li>
- <li><span>/</span></li>
- <?php endforeach ?>
- </ul>
- <?php endif ?>
- <?php endforeach ?>
- </ul>
When I run the website basically nothing happens. The code should work as I've tried it without all the PHP.