title: Display product loop based on tag only in Shopify
body: <p>I'm trying to display a product loop in a Collection template on Shopify. I want to pull all products with a specific tag 'Hydrate' to display within the Collection.</p>
  <p>The template file is collection.custom.liquid and so far I have the below:</p>
  <pre><code>{% for product in collection.products %}   
  {% if product.tags contains &quot;Hydrate&quot; %} 
   Do Something
  {% endif %}
  {% endfor %}
  </code></pre>
  <p>But it doesn't display anything. I have confirmed I do have the tags setup correctly and I'm even using the exact same case sensitivity in case thats a thing.</p>
  <p>If someone could point me in the right direction to display products from the tag 'Hydrate' in a custom collection template that would be great! Thanks so much</p>
  <p><em>EDIT</em></p>
  <p>I've now altered the code and moved it outside any pagination, and added for each product to the below. It now displays however it keeps displaying the same tags 5 times over on the page. Is there an issue with my syntax? Any ideas?</p>
  <pre><code>{% for product in collection.products %} 
    {% for product in products %}
      {% if product.tags contains &quot;Hydrate&quot; %} 
          &lt;p&gt;{{ product.title }}&lt;/p&gt;
      {% endif %}
    {% endfor %}
  {% endfor %}
        
  </code></pre>
  <p><em>EDIT 2</em></p>
  <p>In case anyone else has this same issue in future, the below code is what has ended up working and displays the correct tags, the correct amount of times:</p>
  <pre><code>{% assign products = collection.products %}
    {% for product in products %}
      {% if product.tags contains &quot;Hydrate&quot; %} 
          &lt;p&gt;{{ product.title }}&lt;/p&gt;
    {% endif %}
  {% endfor %}
  </code></pre>