Conditional for Checking if Category has Facets

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • afiumano
    Mighty Mivite




    • Dec 2010
    • 765

    #1

    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?
  • Matt Zimmermann
    Mega Mivite










    • Apr 2008
    • 2482

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

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment

    • afiumano
      Mighty Mivite




      • Dec 2010
      • 765

      #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

      • Matt Zimmermann
        Mega Mivite










        • Apr 2008
        • 2482

        #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

        Miva Web Developer
        Alchemy Web Development
        https://www.alchemywebdev.com
        Site Development - Maintenance - Consultation

        Miva Certified Developer
        Miva Professional Developer

        https://www.dev4web.net | Twitter

        Comment

        • afiumano
          Mighty Mivite




          • Dec 2010
          • 765

          #5
          Perfect. That worked. Thanks.

          Comment

          Working...
          X