Filter by variants using AND condition
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 pleaseIf 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.
Quote from nickv on October 18, 2021, 23:52We have a use case where we'd like the filtering to provide variant level filtering using the AND condition. Right now, when we select multiple attribute filters, it seems like some filters are still available for selection when they should not be. Here's a screenshot to demonstrate the issue:
We have a use case where we'd like the filtering to provide variant level filtering using the AND condition. Right now, when we select multiple attribute filters, it seems like some filters are still available for selection when they should not be. Here's a screenshot to demonstrate the issue:

Quote from Pablo Borysenco on October 19, 2021, 10:58Hello
Filter does not work with variants. Your shop displays parent products and the database query is only for parent products
And if this parent product has these attributes, the filter will display it
Hello
Filter does not work with variants. Your shop displays parent products and the database query is only for parent products
And if this parent product has these attributes, the filter will display it
Quote from nickv on October 19, 2021, 15:51I may have found a solution by modifying the counts query. The issue is that I really need the current term fed into woof_dynamic_count_attr. Would it be possible to have line 1694 of wp-content/plugins/woocommerce-products-filter/index.php from:
$args = apply_filters('woof_dynamic_count_attr', $args, $custom_type);
to:
$args = apply_filters('woof_dynamic_count_attr', $args, $custom_type, $curr_term);
I may have found a solution by modifying the counts query. The issue is that I really need the current term fed into woof_dynamic_count_attr. Would it be possible to have line 1694 of wp-content/plugins/woocommerce-products-filter/index.php from:
$args = apply_filters('woof_dynamic_count_attr', $args, $custom_type);
to:
$args = apply_filters('woof_dynamic_count_attr', $args, $custom_type, $curr_term);
Quote from Pablo Borysenco on October 20, 2021, 10:50Hello
Did I understand you correctly about variable products? The parent product has all of these taxonomies
I need to know the feasibility of this code change. Then I will pass this on to the developers.
Hello
Did I understand you correctly about variable products? The parent product has all of these taxonomies
I need to know the feasibility of this code change. Then I will pass this on to the developers.
Quote from nickv on October 20, 2021, 16:03We actually are using the plugin to filter by variable product attributes. It seems to be working fine for that. For example, from my screenshot above, Program, Course Dates, and Season are all attributes assigned to the variable product, and it appears to be filtering the correct products which contain those attributes and values. It's fine that only the parent product shows in the results.
We actually are using the plugin to filter by variable product attributes. It seems to be working fine for that. For example, from my screenshot above, Program, Course Dates, and Season are all attributes assigned to the variable product, and it appears to be filtering the correct products which contain those attributes and values. It's fine that only the parent product shows in the results.
Quote from Pablo Borysenco on October 21, 2021, 11:38Hello
I consulted with the developer
Unfortunately, we will not implement this code change.
This code change only works for the taxonomy filter and does not take into account other filters. And it is a private customization for one user.
sorry and thanks for your understanding
Hello
I consulted with the developer
Unfortunately, we will not implement this code change.
This code change only works for the taxonomy filter and does not take into account other filters. And it is a private customization for one user.
sorry and thanks for your understanding
Quote from nickv on October 21, 2021, 15:53Thanks for looking into this. The change actually gives us context though for which taxonomy is currently being counted which allows us to accomplish our goal. I think this would be valuable for anyone trying to hook into the woof_dynamic_count_attr filter. From what I can see currently, there's no way for a developer to know which term is currently being counted when hooking into woof_dynamic_count_attr.
Thanks for looking into this. The change actually gives us context though for which taxonomy is currently being counted which allows us to accomplish our goal. I think this would be valuable for anyone trying to hook into the woof_dynamic_count_attr filter. From what I can see currently, there's no way for a developer to know which term is currently being counted when hooking into woof_dynamic_count_attr.
Quote from Pablo Borysenco on October 22, 2021, 12:10Hello
I understand you, but I have already described it above - https://share.pluginus.net/image/i20211022125337.png
It is possible to change this parameter to
apply_filters('woof_dynamic_count_attr', $args, $custom_type, array('tax'=>$curr_term, 'meta'=>$meta_term));
Hello
I understand you, but I have already described it above - https://share.pluginus.net/image/i20211022125337.png
It is possible to change this parameter to
apply_filters('woof_dynamic_count_attr', $args, $custom_type, array('tax'=>$curr_term, 'meta'=>$meta_term));
Quote from nickv on October 22, 2021, 16:52Hi Pablo,
I understand what you are saying now. Your proposed fix would also work just fine for our needs. Anything that would five us context for the current term being counted.
Hi Pablo,
I understand what you are saying now. Your proposed fix would also work just fine for our needs. Anything that would five us context for the current term being counted.
Quote from nickv on October 22, 2021, 16:57As a side note though, aren't all the other filters already available in the $args variable? That is what we are using to loop through all the other filters. The only context that seems to be missing is the term you are currently doing a count for.
As a side note though, aren't all the other filters already available in the $args variable? That is what we are using to loop through all the other filters. The only context that seems to be missing is the term you are currently doing a count for.
Quote from Pablo Borysenco on October 25, 2021, 12:57Hello
aren't all the other filters already available in the $args variable? - As well as the current term;)
Your proposed fix would also work just fine for our needs. - Unfortunately this will not be included in this new version of the plugin, because this version is already in final testing.
Hello
aren't all the other filters already available in the $args variable? - As well as the current term;)
Your proposed fix would also work just fine for our needs. - Unfortunately this will not be included in this new version of the plugin, because this version is already in final testing.
Quote from nickv on October 25, 2021, 15:45The current term is in the $args array, but it doesn't seem to distinguish which one is the current term. It's just lumped into the other taxonomies so it's hard to determine which one is the current term:
The current term is in the $args array, but it doesn't seem to distinguish which one is the current term. It's just lumped into the other taxonomies so it's hard to determine which one is the current term:

Quote from Pablo Borysenco on October 26, 2021, 12:01Hello
That's what I wanted to tell you.
Hello
That's what I wanted to tell you.