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
<script> | |
$(document).on('click',"#AddToCart-product-template, .buy-bar [name=add]", function() { | |
console.log('added'); | |
var cartString = $('#CartCount').html(); | |
var miniCounter = parseInt(cartString); | |
var qty = 1; | |
var id; | |
{% if product.variants.size > 1 %} | |
id = $('.variant-select-for-id option:selected').data('variant'); |
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
<script> | |
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: [email protected] | |
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus | |
var Shopify = Shopify || {}; | |
Shopify.optionsMap = {}; | |
Shopify.updateOptionsInSelector = function(selectorIndex) { | |
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).on('click','.productId', function(e){ | |
var qty = 1; | |
var id = $(this).data('variant'); | |
addItem=function(qty,id,callback) { | |
var params = {quantity:qty,id:id}; | |
$.ajax({ | |
type: 'POST', | |
url: '/cart/add.js', |
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 downloadJSAtOnload() { | |
var element = document.createElement("script"); | |
element.src = "defer.js"; | |
document.body.appendChild(element); | |
} | |
if (window.addEventListener) | |
window.addEventListener("load", downloadJSAtOnload, false); | |
else if (window.attachEvent) | |
window.attachEvent("onload", downloadJSAtOnload); | |
else window.onload = downloadJSAtOnload; |
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 filterProductsByTag(){ | |
var tagList = []; | |
var tagUrl = ''; | |
var initialURL = ''; | |
$('.tagFilterBox').each( function(){ | |
var tagName = $(this).data('tag'); | |
if ($(this).is(':checked')){ | |
tagList.push(tagName); | |
} | |
}); |
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
$.ajax({ | |
url:'https://michele-mclaughlin-music.myshopify.com/collections/sheet-music?view=ajax', | |
type:'GET', | |
success: function(data){ | |
var dataDump =JSON.parse(data); | |
console.log(dataDump);} | |
}); |
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
{% capture image %}{{ 'test.png' | asset_url | split:'test.png' | first }}{% endcapture %} | |
var srcURL = '{{ image }}'; | |
//Swatch Script | |
$('#wjFilterFront option').each(function(i){ | |
//generate the swatches and add matching data attributes to select options | |
var imageName = $(this).val(); | |
var srcImage = 'https:' + window.srcURL + imageName + '.png'; | |
srcImage.toString(); | |
var index = i++; | |
var swatch = '<a class="swatch-link" href="javascript:void(0)" data-option-index="' + index.toString() +'"><img class="swatch-image" src="test.png" data-tag="' + imageName + '" ></a>'; |
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
$(window).load(function() { | |
$('.swatch-image').each(function() { | |
var srcImageError = ''; // URL Goes here | |
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { | |
this.src = srcImageError; | |
} | |
}); | |
}); |
NewerOlder