PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

How to change the relationship of two attributes from "or" to "and" in a filter?

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

In order to express my meaning clearly, I've created a demo, the URL is:

http://caibee.com/selector-test/

The product is a variable product. It has two attributes: size and color.

It has three size: S, M, XXL
and two color: Gray, Green

So it generated 6 variations in total:

S+Gray
S+Green
M+Gray
M+Green
XXL+Gray
XXL+Green

But actually, the M size doesn't have a Gray color. So I removed"M+Gray", then we only have 5 variations.

On the page http://caibee.com/selector-test/, when I choosed filters as"Gray" and"M", I thought the result should be none. But it showed me the product"WooBeWoo hoodie".

I think the problem is the relationship between the two attributes. It should be"and", but the filter used"or".

Is there any way to solve this problem?

I'm sorry for the trouble and I'm looking forward to hearing from you soon.

best regards,

Jarred

Attached some screenshots for your reference.

I want to know if there is any way to achieve my purpose?

I mean any method, not limited to your plugin.

I will be very appreciated if any suggestion!

Hello Jarred

 It should be"and", but the filter used"or". - NO!"AND" comparison logic between taxonomies

The problem is in a variable product.  Shop and archive template only displays simple and parent products. And the request to the database goes only for these products.

And in fact, the parent product has these attributes - M and  Gray

Unfortunately, I have no idea how to change this behavior.