7

Iam trying hard but still not getting to remove SHOP BY and PRICE FILTER SECTIONS from layered navigation please help me in removing those items.

enter image description here

2 Answers 2

4

Sorry for Downvote actually this is basic question..!!

for removing Price filter Goto Catalog->manage attributes find price attribute and select no in the option Use In Layered Navigation.

for removing SHOP BY goto app/design/frontend/your_theme/default/template/catalog/navigation and in left.phtml file find this code

<div class="block-title">
        <strong><span><?php echo $this->__('Browse By') ?></span></strong>
    </div>

and then put echo in comments. Hope it works.

10
  • Price filter removed but shop by still exists.
    – Abdul
    Dec 3, 2014 at 10:43
  • Clear the cache and reindex data
    – dh47
    Dec 3, 2014 at 10:44
  • done both no use still.
    – Abdul
    Dec 3, 2014 at 10:44
  • may be you have custom theme. Dec 3, 2014 at 10:45
  • then do a this:P add display:none; rule for css class block-title
    – dh47
    Dec 3, 2014 at 10:46
2

create own module and use next snippets

code for your config.xml:

......
    <frontend>
        <events>
            <core_collection_abstract_load_before>
                <observers>
                    <my_module_remove_price>
                        <class>MyModule/observer</class>
                        <method>hidePriceFromLayeredNav</method>
                    </my_module_remove_price>
                </observers>            
            </core_collection_abstract_load_before>
        <events>
.......

Code for your observer:

public function hidePriceFromLayeredNav($event) {
    $collection = $event->getEvent()->getCollection();
    if($collection instanceof Mage_Catalog_Model_Resource_Product_Attribute_Collection){            
        $txt=$collection->getSelect()->__toString();
        if(strpos($txt,'additional_table.is_filterable')){
            $collection->removePriceFilter();
        }           
    }
}

PS: using this logic you can hide prices for some customer groups or using config settings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.