Skip to content

Instantly share code, notes, and snippets.

@everycopy
Created July 5, 2011 11:28
Show Gist options
  • Save everycopy/1064675 to your computer and use it in GitHub Desktop.
Save everycopy/1064675 to your computer and use it in GitHub Desktop.
Shopify products by type in a collection
{% assign collection = collections.future-empire %}
<h1>Products</h1>
{% for product_type in collection.all_types %}
<section class="group">
<h2>{{ product_type }}</h2>
{% for product in collection.products %}
{% if product.type == product_type | handleize %}
<a href="{{ product.url }}" title="{{ product.title }}">
<figure>
<img src="{{ product.featured_image | product_img_url: 'medium' }}" alt="{{ product.title }}">
<figcaption>{{ product.price | money | remove: ' ' | remove: '.00' }}</figcaption>
</figure>
</a>
{% endif %}
{% endfor %}
</section>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment