Created
July 9, 2014 15:24
-
-
Save kyleaparker/1a18794a075dbbc0c3e4 to your computer and use it in GitHub Desktop.
[Shopify] Recently viewed, show image based on image name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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