Category Navigation Sub Menu Links – URGENT!

Hi,

I have the JM Morganite Tempalte and I need to know how to remove the sub categories from the Left hand Category navigation menu,

For example By Default you would have the following menu item:
Auto Salon, With toyota shown below that -- I want to remove "toyota" so that only the main top level cetagories are shown.

Please I need urgent help, I have had a ticket open for almost a week now with now reply and the deadline for my site is monday.

2 answers

congtq 0.00 $tone July 6, 2010
Public

If you are using JM Morganite, you can open and compare 2 files
1. app\design\frontend\base\defaulttemplate\catalog\ navigation\left.phtml -> this file is default by Magento
2. app\design\frontend\default\jm_morganitetemplate\ catalognavigation\sidenav.phtml -> this file is created by Joomlart for JM Morganite

To show only main category, you can do follow:

in app\design\frontend\default\jm_morganitetemplate\ catalognavigation\sidenav.phtml, search below code

PHP Code:

<div class="box base-mini mini-sidenav">

    <div class="head">

        <h4><?php echo $this->__('Category Navigation'?></h4>

        </div>

        <div class="content">

        <ul id="ja-sidenav">

        <?php foreach ($this->getStoreCategories() as $_category): ?>

            <?php echo $this->drawItem($_category?>

        <?php endforeach ?>

        </ul>

    </div>

    <?php echo $this->getChildHtml('topLeftLinks'?>

</div>


and replace with

PHP Code:

<?php $_categories=$this->getCurrentChildCategories() ?>

<?php $_count 
is_array($_categories)?count($_categories):$_categories->count(); ?>

<?php 
if($_count): ?>

<div class="box base-mini mini-sidenav">

    <div class="head">

        <h4><?php echo $this->__('Category Navigation'?></h4>

        </div>

        <div class="content">

        <ul id="ja-sidenav">

        <?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>

    </div>

    <?php echo $this->getChildHtml('topLeftLinks'?>

</div>

<?php endif; ?>


Hope you success.

#1

This question is now closed

Written By

Comments