Is there a way to hide specific products from the product recommendations?

selinadg
Explorer
69 0 34

There are specific products I'm listing on another collections page private to a certain group of people. I don't want these products shown in the recommendations on the regular shop page.

0 Likes
LitExtension
Shopify Partner
1196 152 214

Hi @selinadg,

You can add tag to these products, ex: grouppeople.

Then when displaying the product you just check the tag and don't show it:

{% for tag in product.tags %}

  {% if tag contains 'grouppeople' %}

        hide

        {% break %}

  {% endif %}

{% endfor %}

LitExtension - Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
0 Likes
selinadg
Explorer
69 0 34

@LitExtension where do I put the code?

0 Likes
LitExtension
Shopify Partner
1196 152 214

Hi @selinadg

You add that code where recommendations on the shop page are displayed. Because I don't know the details of the recommendations file, so I can't explain it to you in detail.
Hope it helps!

LitExtension - Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
0 Likes
selinadg
Explorer
69 0 34

@LitExtension I found the product-recommendations.liquid but not sure where to insert this code.

0 Likes

@selinadg 

Please share your product recommendations code.

Kind regards,
Diego

◦ Product page slider & thumbnails with swiping for free themes: Minimal | Debut | Brooklyn | Supply
◦ Replace apps with simple copy/paste code snippets. Examples clicking here.
0 Likes
LitExtension
Shopify Partner
1196 152 214

Hi @selinadg

First you need to add grouppeople tag for the products you don't want to show.

Next you will need to change the code to check it: https://i.imgur.com/zR5Z9hQ.png

{%- for product in recommendations.products -%}

<li class="grid__item small--one-half medium-up--one-quarter">

  {% assign check = 0 %}

  {% for tag in product.tags %}

{% if tag contains 'grouppeople' %}

  {% assign check = 1 %}

  {% break %}

{% endif %}

  {% endfor %}

  {% if check == 0 %}

{% include 'product-card-grid', max_height: 250, product: product, show_vendor: section.settings.show_vendor %}

  {% endif %}

</li>

{%- endfor -%}

Hope it clear to you.

LitExtension - Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!