\/td>
<\/i><\/a><\/td><\/tr>'}),$("div.cart-data .divCartTable table tbody").html(n),$("div.cart-data .divCartTable").removeClass("d-none"))}function removeProduct(n){if(n<=0){Swal.fire({title:"Hata",text:"Ürün silinemiyor!",icon:"error"});return}Swal.fire({title:"Uyarı",text:"Ürünü sepetinizden silmek istediğinize emin misiniz?",showCancelButton:!0,cancelButtonText:"İptal",confirmButtonText:"Evet"}).then(t=>{if(t.isConfirmed){var i=JSON.parse(localStorage.getItem("cart-data")??"[]");if(i.length==0){Swal.fire({title:"Hata",text:"Sepetinizdeki ürün bulunamadı!",icon:"error"});return}i=i.filter(t=>t.id!=n);localStorage.setItem("cart-data",JSON.stringify(i));Swal.fire({title:"Bilgi",text:"Ürün sepetinizden silindi.",icon:"success"});getCartData()}})}function clearCartData(){Swal.fire({title:"Uyarı",text:"Sepetinizdeki tüm ürünler silinecektir, devam etmek istediğinize emin misiniz?",showCancelButton:!0,cancelButtonText:"İptal",confirmButtonText:"Evet"}).then(n=>{n.isConfirmed&&(localStorage.removeItem("cart-data"),getCartData())})}$(function(){getCartData();$(document).on("click",".divCartTable table tbody .btnProcess",function(n){n.preventDefault();removeProduct(parseInt($(this).attr("data-id")||0))});$(document).on("change keyup",".divCartTable table tbody .input-count",function(n){var i,u,t,r;n.preventDefault();i=$(this).attr("data-id");i>0&&(u=parseInt($(this).val()),t=JSON.parse(localStorage.getItem("cart-data")??"[]"),t.length>0&&(r=t.filter(n=>n.id==i),r.length>0&&(r[0].adet=u,localStorage.setItem("cart-data",JSON.stringify(t)))))})})
|