Skip to content

Instantly share code, notes, and snippets.

@kyleaparker
Created July 9, 2014 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyleaparker/1a18794a075dbbc0c3e4 to your computer and use it in GitHub Desktop.
Save kyleaparker/1a18794a075dbbc0c3e4 to your computer and use it in GitHub Desktop.
[Shopify] Recently viewed, show image based on image name
{% raw %}
<script id="recently-viewed-product-template" type="text/x-jquery-tmpl">
{{each(prop, val) images}}
{{if val.toLowerCase().indexOf(".imagename") >= 0 }}
<div id="product-${handle}" class="product">
<div class="image">
<a href="${url}" class="cy">
<img src="${Shopify.Products.resizeImage(val, "medium")}" />
</a>
</div>
<div class="details">
<a href="${url}">
<span class="title">${title}</span>
<span class="price">{{if price_varies}}From {{/if}}${Shopify.formatMoney(price)}</span>
</a>
</div>
</div>
{{/if}}
{{/each}}
</script>
{% endraw %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment