var mobileSnapWidth = 768; //Used all over //Override for ajax Shopify.money_format = '$ {{amount}}'; $(function(){ //Navigation notches $('#header #navblock ul.nav canvas.notch').each(function(){ if (this.getContext){ var ctx = this.getContext('2d'); if(ctx) { ctx.beginPath(); ctx.fillStyle = "#ffffff"; ctx.moveTo(0,10); ctx.lineTo(10,0); ctx.lineTo(20,10); ctx.fill(); } } }); //Want some AJAX in your shop? Only for non-mobile if(!iOS && !android && !otherBrowser && !isIE6) { $('form[action*="/cart/add"]').submit(function(e) { //Responsive check - skip mobile sizes if($('#wrap').width() > 768) { //Prevent normal submit e.preventDefault(); //Disable the add button until this process is over $(e.target).find('.addbutton').attr('disabled', true).addClass('disabled'); //Add the item to your cart Shopify.addItemFromForm($(this).attr('id')); } }); } }); //Function to display a popup message after adding to cart $.extend({ shopAddPopup : function(options) { var settings = $.extend({ title: '', message: '', $positionElement: null }, options); var $popup = $('
').html(settings.message).addClass('addToCartPopup').hide(); /*if(settings.$positionElement != null) { var offset = settings.$positionElement.offset(); $popup.css({'left': offset.left, 'top': offset.top}); }*/ var $otherPopups = $('.addToCartPopup'); if($otherPopups.length > 0) { var toppest = 0; for(var i=0; i<$otherPopups.length; i++) { var thisTop = parseInt($($otherPopups[i]).css('top').replace("px", "")); if(thisTop > toppest) { toppest = thisTop; } } $popup.css('top', toppest + 55); } $popup.appendTo('body').fadeIn(500).delay(3000).fadeOut(1000, function(){ $(this).remove(); }); } }); //Override Shopify.onItemAdded = function(line_item) { //Make button usable again var $addedButton = $('form .addbutton.disabled'); $addedButton.attr('disabled', false).removeClass('disabled'); //Adding to cart successful, update cart Shopify.getCart(); //Show friendly popup $.shopAddPopup({title: "Item added", message: line_item.title + ' added to cart', positionElement: $addedButton}); } //Override Shopify.onError = function(XMLHttpRequest, textStatus) { //Fetch button that triggered this and make it usable again var $addedButton = $('form .addbutton.disabled'); $addedButton.attr('disabled', false).removeClass('disabled'); //Display error message var data = eval('(' + XMLHttpRequest.responseText + ')'); if (!!data.message) { $.shopAddPopup({title: data.message, message: data.description, positionElement: $addedButton}); } else { $.shopAddPopup({message: Shopify.fullMessagesFromErrors(data).join('; '), positionElement: $addedButton}); } }; //Override Shopify.onCartUpdate = function(cart) { $('#header #cart .items').html(cart.item_count + (cart.item_count==1 ? ' item' : ' items')); $('#header #cart .total').html(Shopify.formatMoney(cart.total_price)); //Rebuild the cart summary in sidebar if($('#aside').length > 0) { var $cartsummary = $('#aside .cartsummary').empty(); var $header = $('
').addClass('header'); $header.append($('

').text('Cart Summary')); $header.append($('

').append($('').attr('href','/cart').html(cart.item_count + (cart.item_count==1 ? ' item (' : ' items (') + Shopify.formatMoney(cart.total_price) + ')'))); $cartsummary.append($header); var $sidelist = $('

    '); for(var i=0; i' + cart.items[i].quantity + 'x ' + cart.items[i].title + ''); $sidelist.append(item); } $cartsummary.append($sidelist); } } // ]]>

    Frontpage

    No products found in this collection