Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Created July 31, 2012 11:45
Show Gist options
  • Save Chrisedmo/3216394 to your computer and use it in GitHub Desktop.
Save Chrisedmo/3216394 to your computer and use it in GitHub Desktop.
Shopify: Product Grid Item
<div class="grid-product {% cycle ' alpha', '', ' omega' %}" itemscope itemtype="http://schema.org/Product">
{% if product.compare_at_price_min > 0 %}
<!-- SALE BOX -->
<div class="sale-box">
<p>Sale</p>
</div>
{%endif%}
<div class="product-photo">
<a href="{{ product.url | within: collection }}" title="{{ product.title }}">
<img itemprop="image" src="{{ product.featured_image | product_img_url: 'large' }}" alt="{{ product.featured_image.alt }}" />
</a>
</div>
<h2 class="title" itemprop="name">{{ product.title | truncate: 45 }}</h2>
<p>
{% if product.price_varies %}
<em class="from" itemprop="price"><small>from</small> {{ product.price_min | money }}</em>
{% else %}
<em class="price" itemprop="price">{{ product.price | money }}
{% if product.compare_at_price_max > product.price %}
<del>{{ product.compare_at_price_max | money }}</del>
{% endif %}
</em>
{% endif %}
</p>
<!-- PRODUCT LINK -->
<a href="{{ product.url | within: collection }}" title="{{ product.title }}">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment