How to exclude or limit product recommendations based on tags?

I am not able to use the Related Products feature on my site because my otherwise hidden wholesale products show up on the feed. (And the retail priced items are recommended in the wholesale area.)

I’ve tried adding this code to product-recommendations.liquid but then the recommended products block is no longer visible.

{% if product.tags contains “necklace” %} {% endif %}

I’d appreciate any help!

I’m on Dawn 6.0.2


  

1 Like

Hi @Smeelah ,

You can to add the code before the forloop. Please try to use the edited code below.


  

Thank you @made4Uo

I used the code. Unfortunately, it is still recommending products that do not have the tag.

@Smeelah

Oh sorry. I miss something. This code below should work


  

2 Likes

Amazing. Thank you @made4Uo !

1 Like