I have hidden products from recommendations based on a tag of hidden or product type hidden cart fee, but instead of showing all four products it literally hides that product and only shows 3 products. Any ideas on how to correct this. Below is my code from product recommendation liquid file
{%- for product in recommendations.products -%}
{% unless product.tags contains 'hidden' or product.type contains 'hidden_cart_fee'%}
{% assign sold_out = true %}
{% if product.available %}
{% assign sold_out = false %}
{% endif %}
{% assign first_variant = product.variants[0] %}
{% include ‘unit-price-measurement-grid’, variant: first_variant %}
{% if product.compare_at_price_max > product.price and product.available and settings.sale_badge %}
{{ 'products.general.sale' | t }}
{% endif %}
{% if settings.sold_out_badge and product.available == false %}
{{ 'products.product.sold_out' | t }}
{% endif %}
{% endunless %}
I’m working on a JavaScript solution, but haven’t quite gotten there yet. Have you figured it out yet? I have the same issue on my site…let me know if you do, and otherwise if I figure it out I’ll give you my solution here!
Nope, I was never able to figure it out.
Im also keen to figure this out. I love the idea of product recommendations but we have a hidden custom options feature that we would really like to hide from this recommendation bar which normally (disabled for now) appears at the bottom of each product listing. If anyone has found the code to implement that would be great, realistically need to hide certain products either by tag or vendor via liquid if possible and Im sure the code will need to go in the product_recommendations.liquid file
1 Like
I’m also interested. I am using Route (package protection) and right now you see that as a product that gets displayed here, I had a little work around for hiding it in my collections. But I can’t seem to hide it from the Recommended Products section,
Let me know if anyone still got this problem, I can help
Hi Jesper - can you help me? I just want to hide one product from the dynamic You May Also Like recommended products. It is a gift ribbon that we use for gift wrap - we have to have it as a product per the app we use. But I don’t want it to show up because people can’t buy it individually and it also looks weird. Help!
iF YOU HAVE A SOLUTION PLEASE POST IT PUBLICLY FOR ALL TO SEE.