Quote from Adam on June 12, 2020, 13:47
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.
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.