"+c+"<\/li>",r+="<\/ul><\/div>",$(u).find("td.desc").html(r)}$("div.quickOrderItemEntry").show();$("div.quickOrderContainer").hide()}},complete:function(){AjaxCart.setLoadWaiting(!1)},error:function(){alert("Failed to add the product. Please refresh the page and try one more time.")}}))}$(document).ready(function(){$("#quickOrderPasteEntry-back").click(function(n){n.preventDefault();$("div.quickOrderItemEntry").show();$("div.quickOrderContainer").hide();$("#txtPaste").val("");$("table.qo-table .qo-sku").eq(0).focus()});$("#pasteItemPageLink").click(function(n){n.preventDefault();$("div.quickOrderItemEntry").hide();$("div.quickOrderContainer").show();$("#txtPaste").val("");$("#txtPaste").focus();$("div.lopMsgError").html("").removeClass("lopError")});$("#uploadItemLink").click(function(n){n.preventDefault();$("#import-excel").show();$(".upload-overlay").addClass("active");$("div.upload-error").html("").removeClass("upload-excel-error");$("body").addClass("scroll-hidden")});$("table.qo-table tbody tr").each(function(){var n=guid();$(this).find("td.sku").find("input").attr("name","qosku"+n);$(this).find("td.qty").find("input").attr("name","qoqty"+n)});$("table.qo-table .qo-sku").eq(0).focus();$("#quickOrderItemEntry-addrows2").click(function(){var n="",t=guid(),i,r;n+='
<\/td>
<\/td>
<\/td>
<\/td>
<\/td><\/tr>';i=$("table.qo-table tbody tr").length;i>0?(r="nopadvance.plugin.quickorder.public.addmorethanfiverowalert",$("table.qo-table tbody tr:last").after(n)):$("table.qo-table tbody").html(n);bindautocomplete()});$("#quickOrderPasteEntry-clearrows").click(function(){var n=$("#txtPaste").val();if(n.length>0){if(confirm("Are you sure you want to clear all this items?"))return $("#txtPaste").val("").focus(),$("div.lopMsgError").html("").removeClass("lopError"),!0}else $("#txtPaste").val("").focus(),$("div.lopMsgError").html("").removeClass("lopError")});$("#quickOrderItemEntry-clearrows2").click(function(){for(var r,t=$("table.qo-table tbody tr"),i=0,n=0;n0;n++)r=$(t[n]).find("td.desc").find("div").find("ul").text(),r!=""&&i++;if(i>0){if(confirm("Are you sure you want to clear all this items?"))return window.location.href="",!0}else window.location.href=""});bindautocomplete();$(window).resize(function(){$(".modal-box").css({top:($(window).height()-$(".modal-box").outerHeight())/2,left:($(window).width()-$(".modal-box").outerWidth())/2})});$("#quickOrderItemEntry-import2").click(function(){$("html").addClass("popup-enable");$("#import-excel").show()});$("#import-excel-close").click(function(){$("#import-excel").hide();$(".upload-overlay").removeClass("active");$("html").removeClass("popup-enable");$("div.upload-error").html("").removeClass("upload-excel-error");document.getElementById("upload-quick-order-file").value="";$("body").removeClass("scroll-hidden")})});$("#btn-addtocart").click(function(){AjaxCart.setLoadWaiting(!0);$("div.lopMsg").html("").removeClass("lopError");var n=!0;return $("table.qo-table tr input.qo-sku").each(function(){var t=$(this).val();$.trim(t).length>0&&(n=!1)}),n?($("div.lopMsg").html("Please add atleast one SKU to add to cart").addClass("lopError"),AjaxCart.setLoadWaiting(!1),!1):void 0});$("#btn-wishlist").click(function(){var n=!0;return $("table.qo-table tr input.qo-sku").each(function(){var t=$(this).val();$.trim(t).length>0&&(n=!1)}),n?($("div.lopMsg").html("Please add atleast one SKU to add to wishlist").addClass("lopError"),AjaxCart.setLoadWaiting(!1),!1):void 0});$(document).on("change","input.qo-sku",function(){var i;if(AjaxCart.loadWaiting==!1){var n=$(this).parent().next().next(),r=$(this).parent().next(),u=$(this).attr("name"),t=$(this).parent().next().next().next();$(this).val().length<=0?(n.html(""),$(this).parent().next().find("input").val(""),t.html("")):(AjaxCart.setLoadWaiting(!0),i=u,$.ajax({cache:!1,url:"/quickorder/searchsku?idPostFix="+i+"&sku="+$(this).val(),type:"get",success:function(u){var e,f;u.errormsg?($(".ui-autocomplete").prop("style","top: 523px; left: 387.5px; width: 208px; display: none;"),f='
<\/ul><\/div>',n.html(f),$("li.li-product-name-"+e).tooltip({content:''}))},complete:AjaxCart.resetLoadWaiting(),error:function(){}}))}});$(document).on("click","input.delete-largeordepadrow-button",function(){var n=$(this).closest("tr"),r=$(this).closest("tr").find("td.desc").find("div").find("ul").text(),u=$(this).closest("tr").find("td.price").find("div").text(),t=$("table.qo-table tbody tr"),i;if(r!=""&&u!=""){if(i="Are you sure you want to remove this product?",confirm(i))return t.length==1?(n.remove(),$("#quickOrderItemEntry-addrows2").trigger("click"),document.getElementById("quickOrderItemEntry-addrows2").disabled=!1,!0):(n.remove(),!0);$(n).eq(0).focus()}else t.length<=1?(document.getElementById("quickOrderItemEntry-addrows2").disabled=!1,n.remove(),$("#quickOrderItemEntry-addrows2").trigger("click")):(t.length<=5&&(document.getElementById("quickOrderItemEntry-addrows2").disabled=!1),n.remove())});$("#btn-addtocart-PasteEntry").click(function(){var n=!0,t=$("#txtPaste").val();return t.length>0&&(n=!1),n?($("div.lopMsgError").html("Please add at least one SKU.").addClass("lopError"),AjaxCart.setLoadWaiting(!1),!1):void 0})