'),$("form[name=shopping_cart_mobile]").submit()):($("form[name=shopping_cart]").append(''),$("form[name=shopping_cart]").submit())})),$("#openaccount-point-use-flag").click((function(){$("#openaccount_point_use_flag_changed").val("yes"),$("#form-openaccount-point-use-flag").submit()})),$(".quantityinput").keydown((function(t){-1!==$.inArray(t.keyCode,[46,8,9,27])||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})),$(".quantityinput").blur((function(t){$(".update-basket").trigger("click")})),$(".cartamountbutton").click((function(){if(!cartamountbuttonclicked){cartamountbuttonclicked=!0;var t=$(this).attr("buttonaction"),e=$(this).attr("rel"),a=parseInt($("#quantityinput"+e).val()),i=a,n=parseInt($("#instock"+e).val());if("increase"==t)a>=n?(Swal.fire("Hata Mesajı","Lütfen daha az adet ürün giriniz","error"),$("input[name='quantity["+e+"]']").val(n)):(a++,$("input[name='quantity["+e+"]']").val(a));else if("decrease"==t){if(1==a)return $("input[name='quantity["+e+"]']").val("1"),void(cartamountbuttonclicked=!1);a--,$("input[name='quantity["+e+"]']").val(a)}var c="buttonaction="+t+"&indice="+e+"&quantity="+a;$.ajax({method:"POST",dataType:"JSON",url:"processnaked.php?p=json&cartamountchange",data:c,success:function(t){try{if(t.success){if(t.refreshcartpage)return void(window.location.href="index.php?p=showcustomerbasket&refreshcartpage");{$("#quantityinput"+e).val(t.newquantity),$("tr[lineindice="+e+"] .del-price span").html(t.delprice),$("tr[lineindice="+e+"] .one-price span").html(t.oneprice),$("tr[lineindice="+e+"] .total-price span").html(t.totalprice),$("div[lineindice="+e+"] .total-price span").html(t.totalprice),$("#cargocarttextdiv").html(t.cargoCartText);let a=$("div .productstotalpricediv h4 span").html();$("div .productstotalpricediv h4").html(t.productstotalpricediv+""+a+""),$("div .cargopricediv h4").html(t.cargopricediv+""+a+""),$("div .discountpricediv h4").html(t.discountpricediv+""+a+""),$("div .totalpricediv h4").html(t.totalpricediv+""+a+"")}}else Swal.fire("Hata Mesajı",t.message,"error"),$("input[name='quantity["+e+"]']").val(i);cartamountbuttonclicked=!1}catch(t){Swal.fire("Hata Mesajı",t.message,"error"),cartamountbuttonclicked=!1}},error:function(t){Swal.fire("Hata Mesajı","İşlem gerçekleştirilemedi ","error"),cartamountbuttonclicked=!1}})}})),$(".leavebasketandpay").click((function(){window.location="index.php?p=dopayment"})),$(".leavebasketandgoback").click((function(){history.go(-1)})),$(".emptycart").click((function(){window.location="index.php?p=showcustomerbasket&doemptycart=doit"})),$(".addbaskettowishlist").click((function(){$.ajax({method:"POST",dataType:"JSON",url:"processnaked.php?p=wishlist_output",data:"action=addbaskettowishlist",success:function(t){try{t.success?window.location.href="index.php?p=wishlist&addbaskettowishlist":Swal.fire("Hata Mesajı",t.message,"error")}catch(t){Swal.fire("Hata Mesajı",t.message,"error")}},error:function(t){Swal.fire("Hata Mesajı","İşlem gerçekleştirilemedi (Err)","error")}})}))}));