Shopify themes, liquid, logos, and UX
Hi,
How can I hide a certain product from the recommendations/you may also like section? I'm using the Dawn theme.
Thanks heaps 🙂
Solved! Go to the solution
This is an accepted solution.
You can try this code by following these steps:
Step 1: Add 'hidden' tag for the products you want to hidden.
Step 2: Go to the online store ->Theme ->Edit Code.
Step 3: Find the related-products.liquid file and add code below to the file.
{% unless recommendation.tags contains 'hidden' %}
{% endunless %}
Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!
Add a Tag to the Product:
Edit Dawn Theme Code:
{% for recommendation in recommendations.products %}
{% unless product.tags contains 'hidden-recommendation' %}
<!-- Your product display code -->
{% endunless %}
{% endfor %}
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution and click like.
Was I helpful?
Sandesh Paudyal |
| Shopify Developer
Need help with your store?
sandeshpaudyal99@gmail.comFor quick response - Message Me : +9779851353732
Hi. Thank you for your response. I clicked edit code and searched for product-recommendations.liquid but I don't have it. Any other name I could search for?
If your dawn theme is 2.0 then the name should be the same. If not then access to the store is required for further investigation.
Thanks
Was I helpful?
Sandesh Paudyal |
| Shopify Developer
Need help with your store?
sandeshpaudyal99@gmail.comFor quick response - Message Me : +9779851353732
Hello @chameleon1
Welcome to Shopify Community.
Please check for related-products.liquid file
This is an accepted solution.
You can try this code by following these steps:
Step 1: Add 'hidden' tag for the products you want to hidden.
Step 2: Go to the online store ->Theme ->Edit Code.
Step 3: Find the related-products.liquid file and add code below to the file.
{% unless recommendation.tags contains 'hidden' %}
{% endunless %}
Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!
Hello, I am using the Palo Alto theme. I've tried inserting the snippet, as shown in the correct file, but it is returning an error. Do I need different syntax because of the theme?
Here's the code appearing on the page:
{%- if block.type == 'related' and product.collections.size > 0 -%}
<div id="{{ related_id }}" data-related-products data-limit="{{ product_recommendations_limit }}" data-product-id="{{ product.id }}" {{ block.shopify_attributes }}>
{%- if recommendations.performed and recommendations.products_count > 0 -%}
{{ headings_markup }}
<div class="carousel__container">
<div class="carousel carousel--inactive carousel--mobile"
data-slider
data-slider-id="related-slider--{{ section.id }}"
tabindex="0"
>
{%- for product in recommendations.products -%}
{%- assign animation_delay = forloop.index0 -%}
{%- render 'product-grid-item',
product: product,
carousel: true,
columns_mobile: columns_mobile,
animation_delay: animation_delay,
section_width: section_width,
animation_anchor: related_anchor
-%}
{%- endfor -%}
</div>
</div>
{%- endif -%}
Did this work for you? It didn't work for me?
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024