Tuesday 2 July 2013

Hide category in filter option

Untitled Document

This is what I did to remove the “Category” section from my layered navigation so I wouldnt have any repeat information with the attributes I wanted in the layered navigation.

go to app/design/frontend/default/default/template/catalog/layer and open up view.phtml for edit.

This is the code I have within the “dl” tags:

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

All I did was add the if statement to allow everything in layered navigation except the group with the name of “Category.” I dont have Minimal Price in my nav but Im sure this would work for that too, just add it in the if statement.

No comments:

Post a Comment