Skip to content

Instantly share code, notes, and snippets.

View nickmealey's full-sized avatar

Nick Mealey nickmealey

View GitHub Profile
# -- Collection many to many Pages --
# templates/collection.liquid
<div data-relatable="collection.pages" data-relatable-id="{{collection.id}}">
{% raw %}
{{#pages}}
<a href="/pages/{{handle}}">{{title}}</a>
{{/pages}}
{% endraw %}
</div>
{% comment %} templates/page.liquid {% endcomment %}
<div data-relatable="page.collections" data-relatable-id="{{page.id}}">
{% raw %}
{{#collections}}
<a href="/collections/{{handle}}">{{title}}</a>
{{/collections}}
{% endraw %}
</div>
module.exports = function(grunt) {
// The order of JS files that get loaded
var build_files = ['scripts/app/app.js',
'scripts/lib/*.js',
'scripts/models/*.js',
'scripts/plugins/*.js',
'scripts/controllers/*.js'
];
// Project configuration.
<script>
Shopify.currentProduct = {{ product | json }};
if (Shopify.currentProduct) {
console.log(Shopify.currentProduct.variants);
}
</script>
<html>
<head>
{{ content_for_header }}
{% include 'head' %}
</head>
<body>
{% include 'header' %}
<main id="main">
{{ content_for_layout }}
</main>
{% layout none %}
{% paginate search.results by 50 %}
{
"results": {{ search.results | json }}
}
{% endpaginate %}
$.getJSON('/search?q=shirt&view=json', function(response) {
console.log(response)
});
{% layout none %}
{
"first_name": "{{customer.first_name}}",
"last_name": "{{customer.last_name}}",
"email": "{{customer.email}}",
"id": {{customer.id}},
"name": "{{customer.name}}",
"orders_count": {{customer.orders_count}}
}
var Customr = {
baseUrl: "https://customr.heliumdev.com",
{% if customer %}
shopifyCustomer: {
id: {{ customer.id }},
token: {{ customer.metafields.customr_auth.token | json }}
},
{% endif %}
ready: function() {
// Fires when all the proper data has been loaded in