Friday, April 20, 2012

Magento Remove Category from left Navigation

Magento By default shows the Category on the left side navigation but sometime we don't require to show the category on left side

so easy way to remove just open the following file and



app/design/frontend/default/yourtheme/catalog/layer/view.phtml

at line no 48 of the following file add the following if condition

<?php if($this->canShowBlock()): ?>

<div class=”box layered-nav”>

<div class=”head”>

<h3><?php echo $this->__(’Shop by’) ?></h3>

</div>

<div class=”border-creator”>

<?php echo $this->getStateHtml() ?>

<?php if($this->canShowOptions()): ?>

<div class=”narrow-by”>

<h4><?php echo $this->__(’Browsing Options’) ?></h4>

<dl id=”narrow-by-list”>

<?php $_filters = $this->getFilters() ?>

<?php foreach ($_filters as $_filter): ?>

<?php if($_filter->getItemsCount()): ?>

<?php if($_filter->getName() != “Category”){ ?>

<dt><?php echo $this->__($_filter->getName()) ?></dt>

<dd>

<?php echo $_filter->getHtml() ?>

</dd>

<?php } endif; ?>

<?php endforeach; ?>

</dl>

<script type=”text/javascript”>decorateDataList(’narrow-by-list’)</script>

</div>

<?php endif; ?>

</div>

</div>

<?php endif; ?>
that's it your category will get removed

3 comments:

  1. Thanks, worked for me in Magento 1.7.0.2

    Note, the path is:

    app/design/frontend/default/yourtheme/TEMPLATE/catalog/layer/view.phtml

    (you missed TEMPLATE)

    Thanks!

    ReplyDelete
  2. This removed the entire left column of filters, not only the category filter - in ver. 1.7.0.2

    ReplyDelete
  3. it works correct in magento 1.7.2 ..let me know what error you are getting

    ReplyDelete

Thankyou for your Comments

LinkWithin

Blog has moved, searching new blog...