WordPress.org

Forums

WooCommerce - excelling eCommerce
WooCommerce Layered Nav Filter - multiple attributes don't work as expected (6 posts)

  1. kyleduncan
    Member
    Posted 7 months ago #

    Hi,

    I have a problem with filtering by multiple attributes at a time using the Layered Nav widgets.

    My site uses three attributes:
    - Colour
    - Clothing type
    - Brand

    I have setup 3 instances of the Layered Nav widget in the sidebar to allow customers to find what they want. For all 3 I am using the query type of "OR", so that if a customer enables the Blue and Green and Red filter options, they can see any product that is either Blue OR Green OR Red. Similarly for Brand and clothing type.

    Where I get stuck is that these widgets don't seem to have an option to specify AND or OR between attributes. I would expect the following logic when I use a clothing filter on a website:

    Color: green OR blue
    AND
    Brand: Nike OR Adidas
    AND
    Type: Accessories OR Tops OR Bottoms

    but instead everything is just one long OR query so a piece of clothing could be blue OR an accessory OR nike OR green OR adidas.

    The result is that customers get lots of products they don't want to see i.e. a Puma product shows up because it's Blue, even if the brand filter only wants Nike or Adidas.

    Is there any way to chain queries together so that WITHIN an attribute we use OR, but across attributes we use AND? I imagine the SQL query for this wouldn't be too complex, I'm just hoping there's an extension that would handle this for me.

    Thanks in advance!

    https://wordpress.org/plugins/woocommerce/

  2. miketopher
    Member
    Posted 7 months ago #

    You have to add multiple widgets, specify the attribute you want that one to display.

    Then, if its the drop down and someone chooses Green, the page will refresh and show all green. Then from that page they can select Nike under Brand and show all Green Nikes...

    its not really setup ideally, it should be One widget where you chose the attributes to let the customer choose from but for whatever reason thats not how it is.

  3. kyleduncan
    Member
    Posted 7 months ago #

    hi Mike,

    Thanks for your reply. Your description is exactly how I would imagine it would work, and I do have 3 separate instances of the widget installed, but that isn't what happens for me. I hit green and see all green products on page reload, then i hit Nike and see all Green PLUS all Nike (MORE products instead of LESS).

    Can i confirm you're referring to the built in (free) widgets from WooCommerce (the layered nav filter ones) rather than the paid-for plugin called "Ajax enhanced layered navigation"? perhaps if you're talking about the Ajax one it works correctly?

    Cheers!

  4. kickincrochet
    Member
    Posted 6 months ago #

    I have the same issue, did you find a workable solution?

  5. kyleduncan
    Member
    Posted 6 months ago #

    Hi there,

    It seems that the Ajax Enhanced Layered Navigation paid-for plugin works correctly, it's just the free widgets that come with WooCommerce that do not.

    Cheers

  6. Xiakucao
    Member
    Posted 1 week ago #

    I have finally gotten this to work after bulk editing the attributes on 1700 products.
    However, the changes only take effect after opening the products individually and clicking "save attributes" and updating. Updating by selecting all products and clicking edit update does not work either. This isn't really a solution though because I have 25K more products to work on.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags