LED Strip Lights 1
LED Strip Lights – LED Hut infinitePosition ) { pInfScrNode = jQuery(‘.load_more’).last(); pInfScrURL = jQuery(‘.load_more a’).last().attr(“href”); if(!pInfScrLoading && pInfScrNode.length > 0 && pInfScrMore) { jQuery.ajax({ type: ‘GET’, url: pInfScrURL, beforeSend: function() { pInfScrLoading = true; jQuery(‘.loading_img’).fadeIn(); }, success: function(data) { var filteredData = $(data).find(“.mode-view-item”); jQuery(“.cata-product”).append(filteredData); AT_Main.handleGridList(); jQuery(‘.loading_img’).fadeOut(); pInfScrLoading = false; if(jQuery(data).find(“.load_more a”).length){ jQuery(‘.load_more a’).last().attr(“href”, jQuery(data).find(“.load_more a”).last().attr(“href”)); } else{ pInfScrMore = false; jQuery(‘.load_more’).remove(); } }, dataType: “html” }); } } } $(document).ready(function () { $(window).scroll(function(){ $.doTimeout( ‘scroll’, 100, pInfScrExecute); }); }); ]]>

QTY: ‘ + item.quantity + ‘

‘ + Shopify.formatMoney(item.price, ‘£{{amount}}’) + ‘

‘).appendTo(table); }); jQuery(‘

Cart Total’ + Shopify.formatMoney(cart.total_price, ‘£{{amount}}’) + ‘

‘).appendTo(table_action); } else { jQuery(‘

Your cart is currently empty

‘).appendTo(cart_summary); } } }); } } updateCartDesc(cart); if (window.BOLD && BOLD.common && BOLD.common.eventEmitter && typeof BOLD.common.eventEmitter.emit === ‘function’){ BOLD.common.eventEmitter.emit(‘BOLD_COMMON_cart_loaded’); } }; function updateCartDesc(data){ if(typeof window.BOLD !== ‘undefined’ && typeof window.BOLD.common !== ‘undefined’ && typeof window.BOLD.common.cartDoctor !== ‘undefined’) { // NOTE: “cart” should be the variable containing the cart json data data = window.BOLD.common.cartDoctor.fix(data); } var $cartLinkText = $(‘.cart-target .number’); var $cartPrice = Shopify.formatMoney(data.total_price, ‘£{{amount}}’); switch(data.item_count){ case 0: $cartLinkText.html(‘0’); break; case 1: $cartLinkText.html(‘1’); break; default: $cartLinkText.html(” + data.item_count + ”); break; } $cartLinkText.append($cartPrice); $(‘.addcart-modal-subtotal’).html(‘Cart Total:’ +Shopify.formatMoney(data.total_price, ‘£{{amount}}’)); // Update free shipping var _cart_total = data.total_price ,_free_shipping_price = 40 ,_free_shipping_price_100 = 40*100; if (_cart_total > _free_shipping_price_100){ $(‘.sb-progress’).html(‘100%’); $(‘.sb-text’).html(‘Free shipping for orders over ‘ + Shopify.formatMoney(_free_shipping_price_100, “£{{amount}}”)); } else{ var _progress = Math.floor(_cart_total / _free_shipping_price) ,_spend = _free_shipping_price_100 – _cart_total; $(‘.sb-progress’).html(” + _progress + ‘%’); $(‘.sb-text’).html(‘Spend ‘ + Shopify.formatMoney(_spend, “£{{amount}}”) + ‘ reach FREE SHIPPING! Continue shopping to add more products to your cart and receive free shipping for orders over ‘ + Shopify.formatMoney(_free_shipping_price_100, “£{{amount}}”)); } if (window.BOLD && BOLD.common && BOLD.common.eventEmitter && typeof BOLD.common.eventEmitter.emit === ‘function’){ BOLD.common.eventEmitter.emit(‘BOLD_COMMON_cart_loaded’); } } Shopify.onCartUpdate = function(cart) { if(typeof window.BOLD !== ‘undefined’ && typeof window.BOLD.common !== ‘undefined’ && typeof window.BOLD.common.cartDoctor !== ‘undefined’) { // NOTE: “cart” should be the variable containing the cart json data cart = window.BOLD.common.cartDoctor.fix(cart); } Shopify.updateCartInfo(cart, ‘#cart-info #cart-content’, ‘shopping-cart’); if (window.BOLD && BOLD.common && BOLD.common.eventEmitter && typeof BOLD.common.eventEmitter.emit === ‘function’){ BOLD.common.eventEmitter.emit(‘BOLD_COMMON_cart_loaded’); } }; $(window).load(function() { Shopify.getCart(function(cart) { Shopify.updateCartInfo(cart, ‘#cart-info #cart-content’); }); $(‘.cart-sb’).on(‘click’, ‘.cart-close’, function(e){ var prodId = $(e.currentTarget).data(‘cart-item’); $(‘body’).addClass(‘cart-loading’); $.ajax({ type: ‘POST’, url: ‘/cart/change.js’, data: { quantity: 0, id: prodId }, dataType: ‘json’, error: function(err){ console.log(err); }, success: function(resp) { $(‘body’).removeClass(‘cart-loading’); Shopify.updateCartInfo(resp, ‘#cart-info #cart-content’); if(typeof cartObj != “undefined”) { cartObj.syncCartSB(resp, prodId) } else { Currency.convertAll(‘GBP’, Currency.currentCurrency); } // Update free shipping var _cart_total = resp.total_price ,_free_shipping_price = 40 ,_free_shipping_price_100 = 40*100; if (_cart_total > _free_shipping_price_100){ $(‘.sb-progress’).html(‘100%’); $(‘.sb-text’).html(‘Free shipping for orders over ‘ + Shopify.formatMoney(_free_shipping_price_100, “£{{amount}}”)); } else{ var _progress = Math.floor(_cart_total / _free_shipping_price) ,_spend = _free_shipping_price_100 – _cart_total; $(‘.sb-progress’).html(” + _progress + ‘%’); $(‘.sb-text’).html(‘Spend ‘ + Shopify.formatMoney(_spend, “£{{amount}}”) + ‘ reach FREE SHIPPING! Continue shopping to add more products to your cart and receive free shipping for orders over ‘ + Shopify.formatMoney(_free_shipping_price_100, “£{{amount}}”)); } } }) }) }); ‘) $(“.qs-quantity .qty-inner .icon-plus”).on(“click”, function() { var oldValue = $(“#qs-quantity”).val(), newVal = 1; newVal = parseInt(oldValue) + 1; $(“#qs-quantity”).val(newVal); }); $(“.qs-quantity .qty-inner .icon-minus”).on(“click”, function() { var oldValue = $(“#qs-quantity”).val(); if(oldValue > 1){ newVal = 1; newVal = parseInt(oldValue) – 1; $(“#qs-quantity”).val(newVal); } }); // Update product image productImage.html(”); var qs_images = productSelect.images; productImage.append(”); if(qs_images.length >= 1){ $.each(qs_images, function(index, value) { productImage.find(‘#gallery-qs-image’).append(‘LED Strip Lights 2‘); }); } else{ productImage.html(‘LED Strip Lights 3‘); } // Update product title productTitle.html(” + productSelect.title + ”); // Update product author productAuthor.html(” + productSelect.vendor + ”); // Update product description var $prod = $this.closest(“.product-wrapper”); productRating.html($prod.find(“.product-review”).html()); productDescription.html($prod.find(“.product-des-list”).html()); // Produc variants var productVariants = productSelect.variants; var productVariantsCount = productVariants.length; productPrice.html(”); productVariantWrapper.html(”); productAddCart.removeAttr(‘disabled’).fadeTo(200,1); if (productVariantsCount > 1) { // Show Variants productVariantWrapper.show(); // Variants element var productVariantElement = $(”,{ ‘id’: (‘#quick-shop-variants-‘ + productSelectID) , ‘name’: ‘id’}); var productVariantOptions = ”; for (var i=0; i < productVariantsCount; i++) { productVariantOptions += ''+ productVariants[i].title +'' }; // Add variants element on page productVariantElement.append(productVariantOptions); productVariantWrapper.append(productVariantElement); // Bind variants to option_selection JS new Shopify.OptionSelectors(('#quick-shop-variants-' + productSelectID), { product: productSelect, onVariantSelected: selectQSOptionCallback }); // Add label if only one product option if (productSelect.options.length == 1){ $('#qs-product-action .selector-wrapper:eq(0)').prepend(''+ productSelect.options[0].name +''); } // Select first variant on page var found_one_in_stock = false; for (var i=0; i < productSelect.variants.length; i++) { var variant = productSelect.variants[i]; if(variant.available && found_one_in_stock == false) { found_one_in_stock = true; for (var j=0; j < variant.options.length; j++){ $('#qs-product-variants .single-option-selector:eq('+ j +')').val(variant.options[j]).trigger('change'); } } } } else { // Hide unnecessary variants productVariantWrapper.hide(); // Build variants element var productVariantElement = $('',{ 'id': ('#quick-shop-variants-' + productSelectID) , 'name': 'id'}); var productVariantOptions = ''; for (var i=0; i < productVariantsCount; i++) { productVariantOptions += ''+ productVariants[i].title +'' }; // Add variants element on page productVariantElement.append(productVariantOptions); productVariantWrapper.append(productVariantElement); // Update the add button to variant id productAddCart.data('variant-id', productVariants[0].id); // Check product is on sale if ( productVariants[0].compare_at_price > 0 && productVariants[0].compare_at_price > productVariants[0].price ) { productPrice.html(”+ Shopify.formatMoney(productVariants[0].price, ‘£{{amount}}’) +” + ”+ Shopify.formatMoney(productVariants[0].compare_at_price, ‘£{{amount}}’) + ”); } else { productPrice.html(”+ Shopify.formatMoney(productVariants[0].price, ‘£{{amount}}’) + ” ); } if (productSelect.available) { productAddCart.removeAttr(‘disabled’).fadeTo(200,1); productAddCart.html(‘Add to cart’); // selected an invalid or out of stock variant } else { // disabled variant doesn’t exist productAddCart.attr(‘disabled’, ‘disabled’).fadeTo(200,0.5); var message = variant ? “Sold Out” : “Sold Out”; productAddCart.html(message); } } }); }); // selectQSOptionCallback var selectQSOptionCallback = function(variant, selector) { // selected a valid and in stock variant if (variant && variant.available) { productAddCart.data(‘variant-id’, variant.id); productAddCart.removeAttr(‘disabled’).fadeTo(200,1); productAddCart.html(‘Add to cart’); // selected an invalid or out of stock variant } else { // disabled variant doesn’t exist productAddCart.attr(‘disabled’, ‘disabled’).fadeTo(200,0.5); var message = variant ? “Sold Out” : “Sold Out”; productAddCart.html(message); } // check if variant is on sale if ( variant.compare_at_price > 0 && variant.compare_at_price > variant.price ) { productPrice.html(”+ Shopify.formatMoney(variant.price, ‘£{{amount}}’) +” + ”+ Shopify.formatMoney(variant.compare_at_price, ‘£{{amount}}’) + ”); } else { productPrice.html(”+ Shopify.formatMoney(variant.price, ‘£{{amount}}’) + ” ); }; } }); ]]>

Source