-
-
Save JamieS/2007201 to your computer and use it in GitHub Desktop.
Display associated image of product variant in cart.liquid
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
<a href="{{ item.product.url }}" title="{{ item.product.title | escape }}"> | |
{% assign found = false %} | |
{% for img in item.product.images %} | |
{% if found == false and item.variant.title contains img.alt %} | |
<img src="{{ img | product_img_url: 'thumb' }}" alt="{{ item.alt | escape }}" /> | |
{% assign found = true %} | |
{% endif %} | |
{% endfor %} | |
{% if found == false %} | |
<img src="{{ item.product.featured_image | product_img_url: 'thumb' }}" alt="{{ item.product.featured_image.alt | escape }}" /> | |
{% endif %} | |
</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment