'AND' Category Relation in Essential Grid Not Working

Hey legends,

On my site (https://straighttothepoolroom.com.au) I want to have 2 dropdown sorting methods. One will be via category and the other will be via product tags that indicate price range ($20-$50, $50-$100 etc.)

The idea is to set it up so that users can choose a category or a few, then they can choose the price of the products that show up in that category.

eg. (Gifts For Geeks OR Gifts For Kids) AND ($20-$50 OR $50-$100)

Right now, I’m having trouble with the category relations.

I have each filter’s seperate logic set to ‘OR’ because I’d like users to be able to select multiple options within each filter, but I want the logic between the two seperate filters set to ‘AND’ so that when people select a category and price range, it doesn’t show up every single other product in that price range that isn’t related to the selected categories.

The problem is, when I select ‘AND’ as the category relation in the source, it seems to break the grid and nothing shows up on the page (not even the essential grid nav bar)

I have a child theme set up so I’ve tried playing with this documentation by ThemePunch:
https://www.themepunch.com/faq/combine-and-with-or-for-category-relation-advanced/

I know how to find the category ID’s, but when I try plugging it all in, I haven’t been able to get it working.

Can one of you lovely people help me sort this out? I would be super grateful!
Thanks

Hi There @DKMGAU

Thanks for writing in! Did you also try disabling your 3rd party plugins and test your issue further? Make sure to purge your server cache before testing.

Also make sure that you’re running PHP v5.6.x or later to avoid any incompatibility issues.

If you’re still having issues, please provide us with your WordPress login credentials in a secure note to check your issue further.

Thanks!

I tried disabling all plugins and it still wouldn’t work.
I’m using PHP 7.0.

I just added a secure note to my last message, would love for you guys to log in and work out what the issue is and to set up the category relations correctly!

Thank-you SO much, you guys are so helpful and I really appreciate it.

Hi @DKMGAU,

Thanks for reaching out.

I don’t see the implementation of that code in your site, please implement it first and we’ll check. Please note that it’s a custom code which we can’t fully support, but I can still check your implementation.

Thanks!

Hey Rad, just reading the documentation for that custom code and I don’t actually think it is even what I need.

I just need the ‘AND’ relation between the two main dropdowns to actually work rather than breaking my site.

I’ve attached some pictures to illustrate exactly what I’m trying to do.
How can I accomplish this?:

Hi @DKMGAU,

You mean it’s not working when you use AND from this option?

It should work with multiple filters, and I checked and it works. It filters by category, then refilter it by price on that group of the category.

Thanks!

No, just tested and that doesn’t work for what I’m doing.

There needs to be ‘OR’ logic used within each dropdown so that users can select multiple options from that dropdown as I tried to explain with my previous pictures.

I’ll try to give another example:

Let’s say a user is looking on the website for gifts for his/her nephew.
The user knows that his/her nephew is a geek, so they choose the category ‘Gifts For Geeks’ and also the category ‘Gifts For Kids’ so that products from BOTH categories show up.
Then their budget is $40, so they choose ‘Under $20’ and also ‘$20 - $50’ so that BOTH of these price ranges show up.

In this situation, If I use ‘AND’ logic in the filter group, only products that meet all the criteria at once will show up. That means the products that show up will have to be tagged as Under $20 AND $20 - $50 which is logically impossible because the two are mutually exclusive.

However, if I use ‘OR’ logic, the ‘OR’ logic is continuous between the two dropdown menus, which means that the aforementioned search will show up ALL products that are listed on the site as Under $20 and also between $20 - $50 even if they aren’t in the chosen categories of ‘Gifts for Geeks’ or ‘Gifts for Kids’.

This is why the relation BETWEEN the two drop-downs must be an ‘AND’ relationship and the relation WITHIN the drop-downs must be an ‘OR’ relationship.

How can I set up this relationship?

Hi @DKMGAU,

Ah, I just thought you mean that you don’t need it to have multiple instances of AND and OR anymore.

Hey Rad, just reading the documentation for that custom code and I don’t actually think it is even what I need.

I just need the ‘AND’ relation between the two main dropdowns to actually work rather than breaking my site.

But unfortunately, that’s not possible with current filters. The filter will just filter the visible items so there is no applicable customization, and the above URL only pertains to custom query upon load (not filter related). Hence, it’s just limited to one AND or OR, multiple isn’t possible.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.