' ; if($(".waio__ntBtn--wrapper").length){}else{ $(checkoutSelector).after(_BtnHtml); } if($("#CartDrawer").find(".waio__ntBtn--wrapper").length){}else{ $("#CartDrawer").find(checkoutSelector).after(_BtnHtml); } if(onlyNetTerms) $(checkoutSelector).hide(); var netBtn = $('[name="waio_net_term"]'); netBtn.on('click', function(e){ e.preventDefault(); $(".drawer__close").click(); var _FromHtml = ''; //alert('asdasd'); fetch_cart(function (error, cart) { if(error){ log(e); log("WAIO Warning", "Error occure at checkout button while fetching cart object","warning"); redirectToURL("https://"+shop+"/checkout"); } console.log(cart, 'cart'); var _itemHtml = ''; var subtotal = $("["+waioSelectors.cartSubtotalPriceAttr+"]"); cart.items.forEach(function(item, i){ var _itemTotalPrice = $("["+waioSelectors.wholesaleDataKeyAttr+"="+item.variant_id+"]"); var _itemPrice = $("["+waioSelectors.waioSingleDataKeyAttr+"="+item.variant_id+"]"); if(!_itemTotalPrice.length){ _itemTotalPrice = "$"+(Number(_itemPrice.text().split("$")[1].trim()) * item.quantity).toFixed(2)+""; }else{ _itemTotalPrice = _itemTotalPrice.html(); } var _itemVariantTitle = item.variant_title!=null?item.variant_title:''; var img = item.image; if(img){}else{ img = "https://cdn.shopify.com/s/files/1/0256/3843/6941/files/noimage.gif?v=1579714264"; } _itemHtml+=''+ '