Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php if($_filter->getItemsCount()):?>
  2. <?php $show=1;?>
  3. <!-- curern filter price and currentc Cat match -->
  4. <?php if($_filter->getFilter()->getRequestVar()!=='price'){?>
  5. <?php if(Mage::registry('current_category') &&(Mage::registry('current_category')->getId()==$catId)):
  6. $show=0;
  7. endif;
  8. ?>
  9. <?php } ?>
  10. <!-- check show
  11. <?php if($show==1){?>
  12. <?php echo $_filter->getHtml() ?>
  13. <?php } ?>
  14. <?php endif;?>
  15.  
  16. <?php
  17. // create an array of the category ids in which you don't want the price filter
  18. $restricted_categories = [3, 4, 10, 14];
  19. $currentCategoryId = $block->getLayer()->getCurrentCategory()->getId();
  20. ?>
  21. .....
  22. .....
  23. .....
  24. <?php foreach ($block->getFilters() as $filter): ?>
  25. <?php
  26. if (in_array($currentCategoryId, $restricted_categories) && $filter->getRequestVar() == 'price') {
  27. continue;
  28. }
  29. ?>
  30. .....
  31. .....
  32. .....
  33. <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement