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
{% assign send_to_cart = true %} | |
{% assign send_to_checkout = false %} | |
{% for tag in product.tags %} | |
{% if tag contains "no__redirect" %} | |
{% assign send_to_cart = false %} | |
{% endif %} | |
{% if tag contains "send_to_checkout" %} | |
{% assign send_to_checkout = true %} | |
{% endif %} |
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
{% assign current_variant = product.selected_or_first_available_variant %} | |
<div id="richsnippet"> | |
<div itemscope itemtype="http://schema.org/Product"> | |
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}"> | |
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}"> | |
<meta itemprop="name" content="{{ product.title | escape }}"> | |
<meta itemprop="description" content="{{ product.description | strip_html }}"> | |
{% if product.vendor %}<meta itemprop="brand" content="{{ product.vendor }}">{% endif %} |
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
<link rel="alternate" hreflang="x-default" href="{{ canonical_url | replace: shop.domain, 'www.mystore.com' }}" /> | |
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.mystore.com' }}" hreflang="en-GB" /> | |
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.us.mystore.com' }}" hreflang="en-US" /> | |
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.mystore.com' }}" hreflang="en" /> |
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
{% comment %} | |
Here we have 2 stores: | |
www.urbanexcess.com | |
www.usd.urbanexcess.com | |
set dynamic href lang tags for each to avoid dup. content issues | |
{% endcomment %} |
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
{% for collection in collections %} | |
{% if collection.title == product.vendor %} | |
{% capture thecollection %}<a class="product-brand" href="/collections/{{ collection.handle }}">{{ collection.title }}</a>{% endcapture %} | |
{% endif %} | |
{% endfor %} | |
{% if thecollection == '' %} | |
<a class="product-brand" href="{{ product.vendor | url_for_vendor }}">{{ product.vendor }}</a> | |
{% else %} | |
{{ thecollection }} |
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
<h3>List collection handles (use for testing)</h3> | |
{% for item in cart.items %} | |
{% for collection in item.product.collections %} | |
<p>{{ collection.handle }}</p> | |
{% endfor %} | |
{% endfor %} | |
{% for item in cart.items %} |
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
<!-- variable (shipping title downcased) --> | |
{% capture shipping_title_downcased %}{{ shipping_method.title | downcase }}{% endcapture %} | |
<!-- logic --> | |
<!-- if the order shipping method title downcased contains the word collection --> | |
{% if shipping_title_downcased contains "collection" %} | |
<h1>You can collect your products from our stores 9-5 on weekdays</h1> |
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
looping variants: | |
{% for variant in product.variants %} | |
<p>{{ variant.title }}</p> | |
{% endfor %} | |
... more coming soon... | |
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
{% comment %}this tag loop looks for tag border in the product tags - if it finds it then it adds a class="border_this"{% endcomment %} | |
{% comment %} break is used to escape the loop - more efficient code {% endcomment %} | |
{% for tag in product.tags %} | |
{% if tag contains 'border' %} | |
class="border_this" | |
{% break %} | |
{% endif %} | |
{% endfor %} |
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
{% assign prodid = '' %} | |
{% assign value = '' %} | |
{% if template contains 'index' %} | |
{% assign pagetype = 'home' %} | |
{% elsif template contains 'search' %} | |
{% assign pagetype = 'searchresults' %} | |
{% elsif template contains 'collection' %} | |
{% assign pagetype = 'category' %} | |
{% elsif template contains 'product' %} | |
{% capture prodid %}'{{ product.id }}'{% endcapture %} |