1

How can you remove the Price filter on certain categories?

The price filter doesn't always apply, so I need a way to remove it under certain conditions, such as the category name.

I've looked at the catalog_controller_category_init_after event, which I can then create an if statement for when the category name matches. But I've been unable to find a way to actually remove the price filter.

1 Answer 1

1

Magento, do not have this type event by which you remove Price attribute from Filter on certain categories.

Here are need some little hack code for this case at

app/design/frontend/YOURPACKAGE/YOURTEMPLATE>template>catalog/layer/view.phtml

  <?php if($_filter->getItemsCount()):?>
  <?php $show=1;?>
    <!-- curern filter price and currentc Cat match -->
  <?php if($_filter->getFilter()->getRequestVar()!=='price'){?>
    <?php if(Mage::registry('current_category') &&(Mage::registry('current_category')->getId()==$catId)):
    $show=0;
        endif;
     ?>
  <?php } ?>
  <!-- check show 
  <?php if($show==1){?>
  <?php echo $_filter->getHtml() ?>
  <?php } ?>
  <?php endif;?>

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.