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 %} Custom Search in Turbo Theme - Excludes untagged products {% endcomment %} | |
{% assign product_found = false %} | |
{% assign skip = false %} | |
{% assign collection_group = products | map: 'id' %} | |
{% assign collection_group_thumb = collection_group | append : 'thumb' %} | |
{% assign collection_group_mobile = collection_group | append : 'mobile' %} | |
{% capture new_row %} | |
<br class="clear product_clear" /> |
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
<style> | |
/* Move the zoomed image to the align with the top of the main image*/ | |
#cloud-zoom-big { | |
top:0 !important; | |
background: #fff; | |
width: 100% !important; | |
} | |
/* In this case the zoom lens' boundary container needed to be nudged to be confined to the main image's container*/ | |
.cloud-zoom-lens { |
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 defer() { | |
if (window.jQuery) { | |
//THE CODE | |
} | |
else { | |
setTimeout(function(){ | |
defer(); | |
}, 250); | |
} | |
} |
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; | |
} | |
}); | |
}); |
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
$.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
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
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
$(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
<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) { | |
OlderNewer