Announcement

Collapse
No announcement yet.

Conditional for Checking if Category has Facets

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Conditional for Checking if Category has Facets

    I don't want the word "Filter" to appear if no facets are available for a category. Is there a conditional that will check for facets?

    #2
    If a category has products that are not filterable, then nothing should appear, example: https://colossus.mivareadythemes.com/cold-brew.html .
    Matt Zimmermann
    Front-End Development Director / Miva, Inc.

    Comment


      #3
      What if there was more than one product in that category? Does it still stay hidden then? I am NOT showing that to be the case on my test store: https://dts2290.mivamerchantdev.com/pet-sympathy. This is the conditional above the facets 'hook'
      Code:
      <mvt:if expr="l.settings:facets:facet_count GT 1 OR l.settings:category_listing:products_on_page_count GT 1 OR l.settings:all_products:products_on_page_count GT 1 OR l.settings:search_results:products_on_page_count GT 1">

      Comment


        #4
        You could probably change that to:
        Code:
        <mvt:if expr="l.settings:facets:facet_count GT 1 AND (l.settings:category_listing:products_on_page_count GT 1 OR l.settings:all_products:products_on_page_count GT 1 OR l.settings:search_results:products_on_page_count GT 1)">
        Matt Zimmermann
        Front-End Development Director / Miva, Inc.

        Comment


          #5
          Perfect. That worked. Thanks.

          Comment

          Working...
          X