if ((typeof Shopify) === 'undefined') { window.Shopify = {}; } if ((typeof Shopify.getCart) === 'undefined') { Shopify.getCart = function (callback, cart) { if (!cart) { return jQuery.getJSON('/cart.js', function (cart, textStatus, xhr) { if ((typeof callback) === 'function') { callback(cart, textStatus, xhr); } else { Shopify.onCartUpdate(cart); } }); } else { if ((typeof callback) === 'function') { callback(cart); } else if (typeof Shopify.onCartUpdate === 'function') { Shopify.onCartUpdate(cart); } } }; } window.SLIDECART_UPDATED = function (cart) { Shopify.getCart(function (newcart) { if (newcart.item_count !== cart.item_count || newcart.total_price !== cart.total_price || newcart.token !== cart.token || newcart.items.length !== cart.items.length) { window.SLIDECART_CLOSE(); window.SLIDECART_UPDATE(); window.SLIDECART_OPEN(); } }, cart); }