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

Fix for woof_get_tax_query and Dynamic Recount

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 the codex for woof_get_tax_query it says: Useful for taxonomies relations manipulation, for example changing relation from OR to AND. Doesn't work with dynamic recount together.

This doesn't make sense. We can adjust the taxonomy query results using this filter but the count doesn't reflect that adjustment and so is wrong. For example, in our case I want to hide products that have certain terms from the front-end, but leave them as active products in the backend.

It seems to be a simple one-liner fix - line 1568 in plugin root index.php:

 // AL: fix count not accounting for a filter adjustment
$args['tax_query'] = apply_filters('woof_get_tax_query', $taxonomies);

Assuming it is, can you apply this?

Also to consider is the need for this specific hook. There's already a standard WC hook for adjusting product query: woocommerce_product_query. Would be better to use that rather than a separate one. Then we don't have to code it twice and would give us more flexibility to tweak the filter across the board.

Hello

I will pass your ideas to the developers