Hi there,
I am wanting to hide a certain product from the recommended product section, if there any way of doing this? I have the prestige theme. www.maternallyhappy.com
The product is Myo-Inositol For PCOS
Thanks heaps,
Caitlin
Hi there,
I am wanting to hide a certain product from the recommended product section, if there any way of doing this? I have the prestige theme. www.maternallyhappy.com
The product is Myo-Inositol For PCOS
Thanks heaps,
Caitlin
Please follow the below instructiosn hopefully you get what you need also please accept the solution if it does work for you.
Go to “Online Store” > “Themes”.
Click on “Actions” > “Edit code”.
In the left-hand sidebar, click on “Sections” > “product-recommendations.liquid”.
Scroll down to the product_recommendations block to exclude specific products from the recommendations, you can add a where filter to the for loop that iterates through the recommended products. For example, if you want to exclude products with the tag “exclude-recommendations”, you can modify the loop as follows:
{% for product in product_recommendations.products %}
{% unless product.tags contains ‘exclude-product’ %}
// code to display recommended product
{% endunless %}
{% endfor %}
The unless statement checks if thetags property of the current product contains the “exclude-product” tag.
Thanks
doesn’t seem to work, thank you anyway
Hey, @ManuelH , I’m curious if you ever fixed the issue where hiding the product meant there was just an empty space where it should have been. Running into the same thing.