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
const queryFragment = ` | |
query { | |
products(first: 10) { | |
edges { | |
node { | |
id | |
title | |
} | |
} | |
} |
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
<!--Start of Zopim Live Chat Script--> | |
<script type="text/javascript"> | |
window.$zopim || (function(d, s) { | |
var z = $zopim = function(c) { | |
z._.push(c) | |
}, | |
$ = z.s = | |
d.createElement(s), | |
e = d.getElementsByTagName(s)[0]; | |
z.set = function(o) { |
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
document.addEventListener("DOMContentLoaded", function() { | |
const forms = Array.from(document.querySelectorAll("form.add_to_cart")); | |
forms.forEach(form => { | |
form.addEventListener("submit", e => { | |
e.preventDefault(); | |
const button = form.querySelector("button"); | |
const product_id = button.dataset["prod-id"]; | |
fetch("/cart/add.js", { | |
method: "POST", | |
headers: { |
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
$("#stepOne").on("submit", function(e) { | |
e.preventDefault(); | |
// This is the shape of the data. Email and List_ID are required for every request | |
// the optional params are 'spa_wellness', 'family', 'exclusive_offers' and 'midweek_offers' | |
// the values for these are true or false. You can just submit only the true values if necessary. | |
// this below example is just an idea. Whatever way you want to post the data is up to you. | |
var initial_data = { | |
list_id: "XXXXX", |
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
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' |
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
;(function ( $, window, document, undefined ) { | |
var pluginName = '', | |
document = window.document, | |
defaults ={}; | |
function Plugin( element, options ) { | |
this.element = element; | |
this.options = $.extend( {}, defaults, options) ; |