Quote from Daniela on March 17, 2021, 12:22
Hi there,
I need to enter a filter by product tag . The filter seems to work only in the condition of "AND" between values even if set to "OR" in the "additional options" .
I have also tried modifying the functions.php file by inserting code seen in some of your suggestions such as :
add_filter('woof_main_query_tax_relations', 'my_woof_main_query_tax_relations');
function my_woof_main_query_tax_relations()
{
return array(
'product_cat' => 'OR',
'product_tag' => 'OR',
// 'pa_color' => 'AND'
);
}
or
add_filter('woof_get_tax_query', 'my_woof_get_tax_query');
function my_woof_get_tax_query($tax_args){
//do smth here
$tax_args['relation'] = "OR";
return $tax_args;
}
I made a filter by product category with same filtering logic and nothing else and everything is perfect.
Can you help me?
I have installed the WOOF version - WooCommerce Products Filter v.2.2.4.2
Thanks a lot
Daniela
Hi there,
I need to enter a filter by product tag . The filter seems to work only in the condition of"AND" between values even if set to"OR" in the"additional options" .
I have also tried modifying the functions.php file by inserting code seen in some of your suggestions such as :
add_filter('woof_main_query_tax_relations', 'my_woof_main_query_tax_relations');
function my_woof_main_query_tax_relations()
{
return array(
'product_cat' => 'OR',
'product_tag' => 'OR',
// 'pa_color' => 'AND'
);
}
or
add_filter('woof_get_tax_query', 'my_woof_get_tax_query');
function my_woof_get_tax_query($tax_args){
//do smth here
$tax_args['relation'] ="OR";
return $tax_args;
}
I made a filter by product category with same filtering logic and nothing else and everything is perfect.
Can you help me?
I have installed the WOOF version - WooCommerce Products Filter v.2.2.4.2
Thanks a lot
Daniela