Re: You may also like items

You may also like items

Karla8
Explorer
57 0 13

Hello all,

 

Hope you are well !

 

I was looking how to remove certain items from "you may also like" section and after some digging I managed to do find this :

 

- I added a tag "AVIS" and put this code :

 

{% for recommendation in recommendations.products %}
{% if recommendation.tags contains "AVIS" %}
{% continue %}
{% else %}
<li class="grid__item">
{% render 'card-product',
card_product: recommendation,
media_aspect_ratio: section.settings.image_ratio,
image_shape: section.settings.image_shape,
show_secondary_image: section.settings.show_secondary_image,
show_vendor: section.settings.show_vendor,
show_rating: section.settings.show_rating
%}
</li>
{% endif %}
{% endfor %}

 

It did remove the undesired items. However, it's now blank :

 

Screenshot 2024-09-15 112315.png

 

The idea would be to keep the 4 you may also like items but do not use the ones that contain "AVIS"

 

Custom Chip Bags – Hint of Happiness

password : seiyud

 

Thank you so much in advance for your help !

 

Karla

 

Replies 2 (2)

suyash1
Shopify Partner
10536 1300 1664

@Karla8  it is showing 4 on product page

 

suyash1_0-1726401873503.png

 

Support me | To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30.
Karla8
Explorer
57 0 13

Hello Suyash1,

 

It looks like it only affects this item :

 

Custom Chip Bags – Hint of Happiness

 

When I check other products, I indeed have all 4 🤔