Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joe-dempsey/59b3282d4c9147a23cc206e6d7d9a0a5 to your computer and use it in GitHub Desktop.
Save joe-dempsey/59b3282d4c9147a23cc206e6d7d9a0a5 to your computer and use it in GitHub Desktop.
split products on collections
{% for product in collection.products %}
{% assign split_product = false %}
{% unless product.tags contains "hidden_on_store" %}
{% for tag in product.tags %}
{% if tag contains 'split_to_variants' %} {% assign split_product = true %} {% break %} {% endif %}
{% endfor %}
{% if split_product == true %}
{% for variant in product.variants %}
{% include 'product_variant_item', show_vendor: section.settings.show_vendor, show_quick_shop: section.settings.show_quick_shop %}
{% endfor %}
testing variants
{% else %}
{% include 'product_grid_item', show_vendor: section.settings.show_vendor, show_quick_shop: section.settings.show_quick_shop %}
{% endif %}
{% endunless %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment