Skip to content

Instantly share code, notes, and snippets.

@joe-dempsey
Created December 14, 2016 07:58
Show Gist options
  • Save joe-dempsey/945e76cd1bd630b8c2783408dd3ba7bf to your computer and use it in GitHub Desktop.
Save joe-dempsey/945e76cd1bd630b8c2783408dd3ba7bf to your computer and use it in GitHub Desktop.
loop through shopify tags to see if a product has a tag
{% comment %}this tag loop looks for tag border in the product tags - if it finds it then it adds a class="border_this"{% endcomment %}
{% comment %} break is used to escape the loop - more efficient code {% endcomment %}
{% for tag in product.tags %}
{% if tag contains 'border' %}
class="border_this"
{% break %}
{% endif %}
{% endfor %}
@iths-jonathan-engman
Copy link

Thank you, this really helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment