Step 3: Hide duplicate products from collections pages

Find the liquid file that renders your collections pages. It may be called something like collection-page.liquid. Find the code block that renders each product in the collection and wrap it in the the following unless statement:

{% unless product.tags contains "price_test" %}
 ...
{% endunless %}

In context, the code should look something like this:

{% for product in collection.products %}
ย  ย {% unless product.tags contains "price_test" %}
ย  ย  ย  {% ย 
ย  ย  ย  ย  ย render 'product-thumbnail',
ย  ย  ย  ย  ย product: product
ย  ย  ย  ย %}
  ย  {% endunless %}
{% endfor %}

Last updated