This file contains hidden or 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="{{ product.url | within: collection }}" class="grid__image" {% if template == 'product' %}onclick="ga('send', 'event', 'Related Products', 'Clicked Related Product - {{ product.type }}', '{{ product.title }}');"{% elsif template == 'index' %}onclick="ga('send', 'event', 'Homepage Products', 'Clicked Best Sellers - {{ product.title }}');"{% endif %}> | |
{% if product.images.size > 1 %} | |
<img src="{{ product.images[0] | product_img_url: 'large' }}" alt="{{ product.title | escape }}" /> | |
<img src="{{ product.images[1] | product_img_url: 'large' }}" alt="{{ product.title | escape }}" style="display:none" /> | |
{% else %} | |
<img src="{{ product.featured_image.src | img_url: 'large' }}" alt="{{ product.featured_image.alt | escape }}"> | |
{% endif %} | |
</a> |
This file contains hidden or 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
{% comment %} | |
QUICK ADD TO CART | |
https://ecommerce.shopify.com/c/ecommerce-design/t/quick-add-to-cart-254790 | |
Copy and paste this code within your div for your product display within a collection | |
{% endcomment %} | |
<form action="/cart/add" method="post" enctype="multipart/form-data" id="AddToCartForm" class="quick-add-to-cart small--hide clearfix"> | |
{% if product.variants.size > 1 %} | |
<select id="product-select-{{ product.id }}" name='id' class="text-center"> |
This file contains hidden or 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
{% comment %} | |
USES JS-COOKIE | |
https://github.com/js-cookie/js-cookie/blob/master/README.md | |
{% endcomment %} | |
// Make sure 'js-cookie.js' is uploaded to your Shopify Theme's assets folder | |
{{ 'js-cookie.js' | asset_url | script_tag }} | |
{% comment %} | |
Adjust display based on URL parameters |