Limiting Related Products by tag in Shopify’s Dawn 6.0.2 to prevent wholesale items (normally hidden) from appearing in retail recommendations, and vice versa.
Initial attempt: Adding a simple tag check in product-recommendations.liquid caused the entire recommendations block to disappear.
First suggestion: Place the tag-condition check before the for-loop that renders recommended items. Result: still showed products without the intended tag.
Fix: A corrected code approach was provided (placed before and/or within the loop) that properly filters recommendations by the specified tag, ensuring only matching-tag products are shown.
Outcome: The revised code resolved the issue; recommendations now respect tag-based filtering.
Notes: Edits occur in product-recommendations.liquid. Code snippets are central to the solution, but the exact working snippet is not shown in the thread. Discussion concluded with a successful implementation.
I am not able to use the Related Products feature on my site because my otherwise hidden wholesale products show up on the feed. (And the retail priced items are recommended in the wholesale area.)
I’ve tried adding this code to product-recommendations.liquid but then the recommended products block is no longer visible.
{% if product.tags contains “necklace” %} {% endif %}