Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Using category custom design to remove attributes from layered navigation—is it possible? 
 
flufftronix
Member
 
Avatar
Total Posts:  45
Joined:  2007-11-09
Philly, PA
 

OK here’s my situation. I have some redundant categories and attributes (gender and manufacturer) so that I can use both category pages and have attributes always show up in layered navigation. Not ideal but I’m dealing with it. My issue is when I’m navigating in the Men’s and Women’s categories, I need my Gender attribute to not display. Otherwise it offers, say, to sort the Men’s category by the Men’s attribute. Redundant and confusing.

I know how to add and subtract sidebar blocks from category pages via the custom, but is there a way I can unload attributes in a similar fashion? Thanks much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

Here you go…

copy frontend/default/[theme]/template/catalog/layer/view.phtml to frontend/default/[theme]/template/catalog/layer/view_no_gender.phtml

change
<?php if($_filter->getItemsCount()): ?>
to
<?php if($_filter->getItemsCount()&&$_filter->getName()!='Gender'): ?>

Open your category that needs to have gender removed. Now type into the layout update:

<reference name="left">
<action method="unsetChild"><name>catalog.leftnav</name></action>
</reference>
<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view_no_gender.phtml"/>
</reference>

Just that category will have just the ‘Gender’ not showing. A ‘wiki’ article could be added for that little trick wink

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top