') } setTimeout(function(){ WholesaleAllInOne.cartDrawer(); WholesaleAllInOne.couponCodeForm(); $('.cart_item strong.right.price').css('flex-flow','column-reverse') win_recTag(10) },800) },300) }) $(document).on("click",'.js-change-quantity', function() { setTimeout(function(){ WholesalefAllInOne.cartDrawer(); WholesaleAllInOne.couponCodeForm(); $('.cart_item strong.right.price').css('flex-flow','column-reverse') win_recTag(6) },1000) }) $(document).on("change",'[name="updates[]"]', function() { setTimeout(function(){ WholesaleAllInOne.cartDrawer(); WholesaleAllInOne.couponCodeForm(); $('.cart_item strong.right.price').css('flex-flow','column-reverse') win_recTag(6) },1000) }) $('[name="q"]').keyup(function() { console.warn('search input enter') setTimeout(function(){ $('li.item-result').each(function(){ var _an_tag = $(this).find('a').attr('href') _an_tag = _an_tag.split('products/')[1]; if(_an_tag.indexOf('?') > -1){ _an_tag = _an_tag.split('?'); _an_tag = _an_tag[0]; } var _th = $(this); $(this).find('.item-pricing').addClass('waio-collection-grid') jQuery.getJSON('/products/'+_an_tag+'.js', function(product) { console.log(product); var p_price = product.price; var data_id = product.id; _th.find('.item-pricing').attr('data-item-id',data_id ) _th.find('.item-pricing').attr('data-price',p_price ) }); setTimeout(function(){ WholesaleAllInOne.HCSRPTemplate({ elementSelector : ".waio-collection-grid", // If null, it will get value from app's developer tool dataIdSelector : "data-item-id", // If null, it will get value from app's developer tool dataPriceSelector : "data-price", // If null, it will get value from app's developer tool dataVariantSelector : "data-variant-id", // variant id attribute data-variant-id priceDesign : null, // default null saleBadgeDirectParent : null, // default null SaleBadgeDirectChild : null, // default null saleLabelMode : null, // default null saleLabelHTML : null, // default null saleLabelPosition : "same", // default value is same, valid values are after,before,append,prepend }); },500) }) },2500) }) // function _winnn(winss){ // if(winss<=0) return false; // WholesaleAllInOne.cartDrawer(); // setTimeout(function(){ // _winnn(--winss) // },800) // } // $(document).on('click','.product-plus, .icon-minus, .add_to_cart, .quick_shop ',function(){ // setTimeout(function(){ // WholesaleAllInOne.cartDrawer(); // _winnn(5) // },1000) // }) // $(document).on('change','.quantity',function(){ // setTimeout(function(){ // WholesaleAllInOne.cartDrawer(); // },2500) // }) function win_recTag(ab){ if(ab<=0)return false; var save_lngth = $('p.cart_savings.sale').length; if(save_lngth > 0){ $('li.cart_savings.sale.js-cart_savings').css('display','none') $('p.cart_savings.sale').css('display','block') } setTimeout(function(){ win_recTag(--ab) },100) } function win_rec(win){ if(win<=0)return false; $('div article.visely-recommendation-item').each(function(){ var p_handle = $(this).find('a').attr('href') p_handle = p_handle.split('products/')[1] // console.warn(p_handle); var _this = $(this); jQuery.getJSON('/products/'+p_handle+'.js', function(product) { var p_price = current_product.price _this.find('.win_dataPrice').attr('data-price',p_price); }); }) setTimeout(function(){ WholesaleAllInOne.relatedProducts({ elementSelector : ".waio-collection-grid", // If null, it will get value from app's developer tool dataIdSelector : "data-item-id", // If null, it will get value from app's developer tool dataPriceSelector : "data-price", // If null, it will get value from app's developer tool dataVariantSelector : "data-variant-id", // variant id attribute data-variant-id priceDesign : null, // default null saleBadgeDirectParent : '.visely-recommendation-item', // default null SaleBadgeDirectChild : 'a', // default null saleLabelMode : null, // default null saleLabelHTML : ' Special Offer', // default null saleLabelPosition : "before", // default value is same, valid values are after,before,append,prepend }); },800) setTimeout(function(){ win_rec(--win) },1500) } setTimeout(function(){ var labe_lngthss = $('.modal_price span.custom_text').length if (labe_lngthss >=1){ $('.modal_price span.custom_text').css("display", "none"); $('.modal_price span.custom_text:last-child').css("display", "block"); } },1500) // $(document).ready(function(){ // var win_l = $('.banner_holder.win').length // if(win_l > 0){ // $('banner_holder').css('top','10px') // $('banner_holder.win').css('top','0px') // } // }) //Basic functions, and autocall when page reload. WholesaleAllInOne.couponCodeForm(); WholesaleAIO.removeAllEvents(waioSelectors.checkout); WholesaleAIO.registerEvent(waioSelectors.checkout,"click", executeCheckout); WholesaleAllInOne.disable_checkout(); WholesaleAllInOne.order_control(); // waioSelectors.checkout // onChange functions $(document).on('change', waioSelectors.qtyInputFieldClass, function() { $("button[name*=update],input[name*=update]").click(); $(waioSelectors.checkout).attr("disabled","disabled"); setTimeout(function(){ WholesaleAllInOne.cartDiscount(); },500); }); $(document).on('click', waioSelectors.qtyPlusMinusClass, function() { setTimeout(function(){ WholesaleAllInOne.cartDiscount(); },1000); }); // END onChange functions }; var waioLoadScript=function(c,b){var a=document.createElement("script");a.type="text/javascript";a.readyState?a.onreadystatechange=function(){if("loaded"==a.readyState||"complete"==a.readyState)a.onreadystatechange=null,b()}:a.onload=function(){b()};a.src=c;document.getElementsByTagName("head")[0].appendChild(a)}; "undefined"===typeof jQuery||1.7>parseFloat(jQuery.fn.jquery)?waioLoadScript("//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",function(){WholesaleAIO.init(jQuery.noConflict(!0))}):WholesaleAIO.init(jQuery);