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
<!-- Global site tag (gtag.js) --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-XXXXXXXXX"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'AW-XXXXXXXXX', {'allow_enhanced_conversions': true}); | |
</script> |
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
<script> | |
var items = ['id': VARIANT_ID,'quantity': 1]; | |
function addToCart(items){ | |
let formData = { | |
'items': items | |
}; | |
fetch(window.Shopify.routes.root + 'cart/add.js', { |
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
<!-- | |
Probably a bit hacky and i've overlooked an easier solution... | |
But for some reason looping through a "Single line text (List)" type metafield is problematic. | |
At least for me. | |
--> | |
{% assign singleLineList = product.metafields.custom.exampleList | replace:'"','' | replace:'[','' | replace:']','' | split: ',' %} | |
{% for listItem in singleLineList %} | |
<!-- Do stuff --> |
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
<!-- | |
Create a sub-menu for the blog based on specific tags, grouped by a prefix. | |
Example menu: "Yamaha | Suzuki | Harley-Davidson etc" | |
Method: Tag a blog post with "specificPrefix_Yamaha" | |
--> | |
{% assign brandedBlogTagList = '' %} | |
{% for blogTag in blog.all_tags %} |
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
{% assign productCollections = product.collections | map:'handle' %} | |
{% if productCollections contains product.metafields.my_fields.breadcrumb %} | |
<a href="/collections/{{product.metafields.my_fields.breadcrumb}}">{{collections[product.metafields.my_fields.breadcrumb].title}}</a> | |
{%- endif -%} |