This topic has 6 replies, 3 voices, and was last updated 6 years, 8 months ago ago by Rose Tyler
Good day,
I need to restrict related products to tags only and hide related by category products. As far as I understood this is possible, however, I can’t find any recommendation on your forum. Would you mind to share some guidelines or instructions how to do that?
Thank you in advance.
Hello,
There is no option to choose related products query type by default but you can try to implement it by additional customization.
Read this post https://nerdymind.com/our-blog/woocommerce-restricting-related-products-to-tags-only
Do all the changes in the child theme.
Regards
Thank you Olga, I will give it a try and will share the result.
You are welcome!
Regards
Surprisingly I have found a simple solution by editing Theme Functions for child theme (Appearance>Editor).
In case someone will need it, simply add this code:
add_filter( ‘woocommerce_get_related_product_cat_terms’, function( $term_ids, $product_id ){
return array();
}, 10, 2 );
Thanks for the support once again.
Hello,
We are glad that you sorted out.
Feel free to ask if you have any other questions.
Regards
You must be logged in to reply to this topic.Log in/Sign up