PageSourceSearch

https://www.poelediscount.com/themes/default-bootstrap/js/modules/blockcart/ajax-cart.js

js poelediscount.com collected 2026-10-04 03:04:40 UTC 19,805 bytes, 1 lines download raw bytes

1$(document).ready(function(){ajaxCart.overrideButtonsInThePage(),$(document).on("click",".block_cart_collapse",function(t){t.preventDefault(),ajaxCart.collapse()}),$(document).on("click",".block_cart_expand",function(t){t.preventDefault(),ajaxCart.expand()});var t=parseInt((new Date).getTime()/1e3),a=((void 0===$(".ajax_cart_quantity").html()||"undefined"!=typeof generated_date&&null!=generated_date&&parseInt(generated_date)+30<t)&&ajaxCart.refresh(),new HoverWatcher("#header .cart_block")),e=new HoverWatcher("#header .shopping_cart"),i=!1;"ontouchstart"in document.documentElement&&(i=!0),$(document).on("dblclick","#header .shopping_cart > a:first",function(t){t.preventDefault(),t.stopPropagation(),window.location.href=$(this).attr("href")}),$(document).on("click","#header .shopping_cart > a:first",function(t){t.preventDefault(),t.stopPropagation(),i?$(this).next(".cart_block:visible").length&&!a.isHoveringOver()?$("#header .cart_block").stop(!0,!0).slideUp(250):(0<ajaxCart.nb_total_products||0<parseInt($(".ajax_cart_quantity").html()))&&$("#header .cart_block").stop(!0,!0).slideDown(250):window.location.href=$(this).attr("href")}),$("#header .shopping_cart a:first").hover(function(){setTimeout(function(){(0<ajaxCart.nb_total_products||0<parseInt($(".ajax_cart_quantity").html()))&&$("#header .cart_block").stop(!0,!0).slideDown(250)},100)},function(){setTimeout(function(){e.isHoveringOver()||a.isHoveringOver()||$("#header .cart_block").stop(!0,!0).slideUp(250)},100)}),$("#header .cart_block").hover(function(){},function(){setTimeout(function(){e.isHoveringOver()||$("#header .cart_block").stop(!0,!0).slideUp(450)},200)}),$(document).on("click",".delete_voucher",function(t){t.preventDefault(),$.ajax({type:"POST",headers:{"cache-control":"no-cache"},async:!0,cache:!1,url:$(this).attr("href")+"?rand="+(new Date).getTime()}),$(this).parent().parent().remove(),ajaxCart.refresh(),"order"!=$("body").attr("id")&&"order-opc"!=$("body").attr("id")||("undefined"!=typeof updateAddressSelection?updateAddressSelection():location.reload())}),$(document).on("click","#cart_navigation input",function(t){$(this).prop("disabled","disabled").addClass("disabled"),$(this).closest("form").get(0).submit()}),$(document).on("click","#layer_cart .cross, #layer_cart .continue, .layer_cart_overlay",function(t){t.preventDefault(),$(".layer_cart_overlay").hide(),$("#layer_cart").fadeOut("fast"),$(".ets-cfu-button-popup").css("z-index","10000"),$(".has-compact-filter #amazzing_filter").css("z-index","1000001"),$("#smartsupp-widget-container div").css("z-index","10000000"),$('#crisp-chatbox').css('z-index', '1000000')}),$("#columns #layer_cart, #columns .layer_cart_overlay").detach().prependTo("#columns")});var ajaxCart={nb_total_products:0,overrideButtonsInThePage:function(){$(document).off("click",".ajax_add_to_cart_button").on("click",".ajax_add_to_cart_button",function(t){t.preventDefault(),$(".ets-cfu-button-popup").css("z-index","99"),$(".has-compact-filter #amazzing_filter").css("z-index","99"),$("#smartsupp-widget-container div").css("z-index","99"),$('#crisp-chatbox').css('z-index', '99');var t=parseInt($(this).data("id-product")),a=parseInt($(this).data("id-product-attribute")),e=(e=parseInt($(this).data("minimal_quantity")))||1;"disabled"!=$(this).prop("disabled")&&ajaxCart.add(t,a,!1,this,e)}),$(".cart_block").length&&$(document).off("click","#add_to_cart button").on("click","#add_to_cart button",function(t){t.preventDefault(),$(".ets-cfu-button-popup").css("z-index","99"),$("#smartsupp-widget-container div").css("z-index","99"),$('#crisp-chatbox').css('z-index', '99'),ajaxCart.add($("#product_page_product_id").val(),$("#idCombination").val(),!0,null,$("#quantity_wanted").val(),null)}),$(document).off("click",".cart_block_list .ajax_cart_block_remove_link").on("click",".cart_block_list .ajax_cart_block_remove_link",function(t){t.preventDefault();var a,t=0,e=0,i=0,o=$($(this).parent().parent()).find("div[data-id^=deleteCustomizableProduct_]"),r=!1;o&&$(o).length&&void 0!==(a=o.data("id").split("_"))[1]&&(t=parseInt(a[1]),e=parseInt(a[2]),void 0!==a[3]&&(i=parseInt(a[3])),void 0!==a[4])&&(r=parseInt(a[4])),t||(a=$(this).parent().parent().data("id").replace("cart_block_product_","").replace("deleteCustomizableProduct_","").split("_"),e=parseInt(a[0]),void 0!==a[1]&&(i=parseInt(a[1])),void 0!==a[2]&&(r=parseInt(a[2]))),ajaxCart.remove(e,i,t,r)})},expand:function(){$(".cart_block_list").hasClass("collapsed")&&($(".cart_block_list.collapsed").slideDown({duration:450,complete:function(){$(this).parent().show(),$(this).addClass("expanded").removeClass("collapsed")}}),$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:baseDir+"modules/blockcart/blockcart-set-collapse.php?rand="+(new Date).getTime(),async:!0,cache:!1,data:"ajax_blockcart_display=expand",complete:function(){$(".block_cart_expand").fadeOut("fast",function(){$(".block_cart_collapse").fadeIn("fast")})}}))},collapse:function(){$(".cart_block_list").hasClass("expanded")&&($(".cart_block_list.expanded").slide
1Up("slow",function(){$(this).addClass("collapsed").removeClass("expanded")}),$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:baseDir+"modules/blockcart/blockcart-set-collapse.php?rand="+(new Date).getTime(),async:!0,cache:!1,data:"ajax_blockcart_display=collapse&rand="+(new Date).getTime(),complete:function(){$(".block_cart_collapse").fadeOut("fast",function(){$(".block_cart_expand").fadeIn("fast")})}}))},refresh:function(){$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:"undefined"!=typeof baseUri?baseUri+"?rand="+(new Date).getTime():"",async:!0,cache:!1,dataType:"json",data:"undefined"!=typeof static_token?"controller=cart&ajax=true&token="+static_token:"",success:function(t){ajaxCart.updateCart(t)}})},updateCartInformation:function(t,a){ajaxCart.updateCart(t),a?($("#add_to_cart button").removeProp("disabled").removeClass("disabled"),t.hasError&&0!=t.hasError?$("#add_to_cart button").removeClass("added"):$("#add_to_cart button").addClass("added")):$(".ajax_add_to_cart_button").removeProp("disabled")},updateFancyBox:function(){},add:function(i,o,r,s,t,n){var a;if(r&&!checkCustomizations())return contentOnly?(a=(window.document.location.href+"").replace("content_only=1",""),void(window.parent.document.location.href=a)):void($.prototype.fancybox?$.fancybox.open([{type:"inline",autoScale:!0,minHeight:30,content:'<p class="fancybox-error">'+fieldRequired+"</p>"}],{padding:0}):alert(fieldRequired));r?($("#add_to_cart button").prop("disabled","disabled").addClass("disabled"),$(".filled").removeClass("filled")):$(s).prop("disabled","disabled"),$(".cart_block_list").hasClass("collapsed")&&this.expand(),$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:baseUri+"?rand="+(new Date).getTime(),async:!0,cache:!1,dataType:"json",data:"controller=cart&add=1&ajax=true&qty="+(t&&null!=t?t:"1")+"&id_product="+i+"&token="+static_token+(parseInt(o)&&null!=o?"&ipa="+parseInt(o):"&id_customization="+("undefined"!=typeof customizationId?customizationId:0)),success:function(t,a,e){n&&!t.errors&&WishlistAddProductCart(n[0],i,o,n[1]),t.hasError?((contentOnly?window.parent.ajaxCart:ajaxCart).updateCart(t),r?$("#add_to_cart button").removeProp("disabled").removeClass("disabled"):$(s).removeProp("disabled")):((contentOnly?window.parent.ajaxCart:ajaxCart).updateCartInformation(t,r),t.crossSelling&&$(".crossseling").html(t.crossSelling),o?$(t.products).each(function(){null!=this.id&&this.id==parseInt(i)&&this.idCombination==parseInt(o)&&(contentOnly?window.parent.ajaxCart:ajaxCart).updateLayer(this)}):$(t.products).each(function(){null!=this.id&&this.id==parseInt(i)&&(contentOnly?window.parent.ajaxCart:ajaxCart).updateLayer(this)}),contentOnly&&parent.$.fancybox.close()),emptyCustomizations()},error:function(t,a,e){var i="Veuillez rafraîchir la page page car vous vous êtes connecté à un compte client";$.prototype.fancybox?$.fancybox.open([{type:"inline",autoScale:!0,minHeight:30,content:'<p class="fancybox-error">'+i+"</p>"}],{padding:0}):alert(i),r?$("#add_to_cart button").removeProp("disabled").removeClass("disabled"):$(s).removeProp("disabled")}})},remove:function(a,e,i,o){$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:baseUri+"?rand="+(new Date).getTime(),async:!0,cache:!1,dataType:"json",data:"controller=cart&delete=1&id_product="+a+"&ipa="+(null!=e&&parseInt(e)?e:"")+(i&&null!=i?"&id_customization="+i:"")+"&id_address_delivery="+o+"&token="+static_token+"&ajax=true",success:function(t){ajaxCart.updateCart(t),"order"!=$("body").attr("id")&&"order-opc"!=$("body").attr("id")||deleteProductFromSummary(a+"_"+e+"_"+i+"_"+o)},error:function(){var t="ERROR: unable to delete the product";$.prototype.fancybox?$.fancybox.open([{type:"inline",autoScale:!0,minHeight:30,content:t}],{padding:0}):alert(t)}})},hideOldProducts:function(i){var o;0<$(".cart_block_list:first dl.products").length&&(o=null,$(".cart_block_list:first dl.products dt").each(function(){var t=$(this).data("id"),a=t.replace("cart_block_product_","").split("_"),e=!1;for(aProduct in i.products)i.products[aProduct].id!=a[0]||a[1]&&i.products[aProduct].idCombination!=a[1]||(e=!0,ajaxCart.hideOldProductCustomizations(i.products[aProduct],t));e||null!=(o=$(this).data("id"))&&(a=o.replace("cart_block_product_","").split("_"),$('dt[data-id="'+o+'"]').addClass("strike").fadeTo("slow",0,function(){$(this).slideUp("slow",function(){$(this).remove(),0==$(".cart_block:first dl.products dt").length&&($(".ajax_cart_quantity").html("0"),$("#header .cart_block").stop(!0,!0).slideUp(200),$(".cart_block_no_products:hidden").slideDown(450),$(".cart_block dl.products").remove())})}),$('dd[data-id="cart_block_combination_of_'+a[0]+(a[1]?"_"+a[1]:"")+(a[2]?"_"+a[2]:"")+'"]').fadeTo("fast",0,function(){$(this).slideUp("fast",function(){$(this).remove()})}))}))},hideOldProductCustomizations:function(e,t){var a=$('ul[data-id="customization_'+e.id+"_"+e.idCombination+'"]'),a=(0<a.length&&$(a).find("li").each(function(){$(this).find("div").each(function(){var t=$(this).data("id"),a=t.replace("deleteCustomizableProduct_","").split("_");
1parseInt(e.idCombination)!=parseInt(a[2])||ajaxCart.doesCustomizationStillExist(e,a[0])||$('div[data-id="'+t+'"]').parent().addClass("strike").fadeTo("slow",0,function(){$(this).slideUp("slow"),$(this).remove()})})}),$('.deleteCustomizableProduct[data-id="'+t+'"]').find(".ajax_cart_block_remove_link"));e.hasCustomizedDatas||a.length||$('div[data-id="'+t+'"] span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="'+baseUri+"?controller=cart&amp;delete=1&amp;id_product="+e.id+"&amp;ipa="+e.idCombination+"&amp;token="+static_token+'"> </a>'),e.is_gift&&$('div[data-id="'+t+'"] span.remove_link').html("")},doesCustomizationStillExist:function(t,a){var e=!1;return $(t.customizedDatas).each(function(){if(this.customizationId==a)return!(e=!0)}),e},refreshVouchers:function(t){if(void 0===t.discounts||0==t.discounts.length)$(".vouchers").hide();else{for($(".vouchers tbody").html(""),i=0;i<t.discounts.length;i++){var a;0<parseFloat(t.discounts[i].price_float)&&(a="",t.discounts[i].code.length&&(a='<a class="delete_voucher" href="'+t.discounts[i].link+'" title="'+delete_txt+'"><i class="icon-remove-sign"></i></a>'),$(".vouchers tbody").append($('<tr class="bloc_cart_voucher" data-id="bloc_cart_voucher_'+t.discounts[i].id+'">      <td class="quantity">1x</td>      <td class="name" title="'+t.discounts[i].description+'">'+t.discounts[i].name+'</td>      <td class="price">-'+t.discounts[i].price+'</td>      <td class="delete">'+a+"</td></tr>")))}$(".vouchers").show()}},updateProductQuantity:function(t,a){$("dt[data-id=cart_block_product_"+t.id+"_"+(t.idCombination||"0")+"_"+(t.idAddressDelivery||"0")+"] .quantity").fadeTo("fast",0,function(){$(this).text(a),$(this).fadeTo("fast",1,function(){$(this).fadeTo("fast",0,function(){$(this).fadeTo("fast",1,function(){$(this).fadeTo("fast",0,function(){$(this).fadeTo("fast",1)})})})})})},displayNewProducts:function(t){$(t.products).each(function(){var t,a,e,i,o;null!=this.id&&(0==$(".cart_block:first dl.products").length&&($(".cart_block_no_products").before('<dl class="products"></dl>'),$(".cart_block_no_products").hide()),t=this.id+"_"+(this.idCombination||"0")+"_"+(this.idAddressDelivery||"0"),a=this.id+"_"+(this.idCombination||"0"),0==$('dt[data-id="cart_block_product_'+t+'"]').length?(o=parseInt(this.id),this.hasAttributes&&parseInt(this.attributes),e='<dt class="unvisible" data-id="cart_block_product_'+t+'">',i=12<(i=$.trim($("<span />").html(this.name).text())).length?i.substring(0,10)+"...":i,e=(e+='<a class="cart-images" href="'+this.link+'" title="'+i+'"><img  src="'+this.image_cart+'" alt="'+this.name+'"></a>')+'<div class="cart-info"><div class="product-name"><span class="quantity-formated"><span class="quantity">'+this.quantity+'</span>&nbsp;x&nbsp;</span><a href="'+this.link+'" title="'+this.name+'" class="cart_block_product_name">'+i+"</a></div>",this.hasAttributes&&(e+='<div class="product-atributes"><a href="'+this.link+'" title="'+this.name+'">'+this.attributes+"</a></div>"),"undefined"!=typeof freeProductTranslation&&(e+='<span class="price">'+(0<parseFloat(this.price_float)?this.priceByLine:freeProductTranslation)+"</span></div>"),void 0===this.is_gift||0==this.is_gift?e+='<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="'+baseUri+"?controller=cart&amp;delete=1&amp;id_product="+o+"&amp;token="+static_token+(this.hasAttributes?"&amp;ipa="+parseInt(this.idCombination):"")+'"> </a></span>':e+='<span class="remove_link"></span>',e+="</dt>",this.hasAttributes&&(e+='<dd data-id="cart_block_combination_of_'+t+'" class="unvisible">'),this.hasCustomizedDatas&&(e+=ajaxCart.displayNewCustomizedDatas(this)),this.hasAttributes&&(e+="</dd>"),$(".cart_block dl.products").append(e)):(i=this,$.trim($('dt[data-id="cart_block_product_'+t+'"] .quantity').html())==i.quantity&&$.trim($('dt[data-id="cart_block_product_'+t+'"] .price').html())==i.priceByLine||(this.is_gift?$('dt[data-id="cart_block_product_'+t+'"] .price').html(freeProductTranslation):$('dt[data-id="cart_block_product_'+t+'"] .price').text(i.priceByLine),ajaxCart.updateProductQuantity(i,i.quantity),i.hasCustomizedDatas&&(customizationFormatedDatas=ajaxCart.displayNewCustomizedDatas(i),($('ul[data-id="customization_'+a+'"]').length?($('ul[data-id="customization_'+a+'"]').html(""),$('ul[data-id="customization_'+a+'"]')):i.hasAttributes?$('dd[data-id="cart_block_combination_of_'+t+'"]'):$(".cart_block dl.products")).append(cu
1stomizationFormatedDatas)))),$(".cart_block dl.products .unvisible").slideDown(450).removeClass("unvisible"),o=$('dt[data-id="cart_block_product_'+t+'"]').find("a.ajax_cart_block_remove_link"),this.hasCustomizedDatas)&&o.length&&$(o).each(function(){$(this).remove()})})},displayNewCustomizedDatas:function(a){var e="",i=parseInt(a.id),o=void 0===a.idCombination?0:parseInt(a.idCombination),r=$('ul[data-id="customization_'+i+"_"+o+'"]').length;return r||(a.hasAttributes||(e+='<dd data-id="cart_block_combination_of_'+i+'" class="unvisible">'),null==$('ul[data-id="customization_'+i+"_"+o+'"]').val()&&(e+='<ul class="cart_block_customizations" data-id="customization_'+i+"_"+o+'">')),$(a.customizedDatas).each(function(){var t=0;customizationId=parseInt(this.customizationId),o=void 0===a.idCombination?0:parseInt(a.idCombination),e+='<li name="customization"><div class="deleteCustomizableProduct" data-id="deleteCustomizableProduct_'+customizationId+"_"+i+"_"+(o||"0")+'"><a rel="nofollow" class="ajax_cart_block_remove_link" href="'+baseUri+"?controller=cart&amp;delete=1&amp;id_product="+i+"&amp;ipa="+o+"&amp;id_customization="+customizationId+"&amp;token="+static_token+'"></a></div>',$(this.datas).each(function(){this.type==CUSTOMIZE_TEXTFIELD&&$(this.datas).each(function(){if(0==this.index)return e+=" "+this.truncatedValue.replace(/<br \/>/g," "),!(t=1)})}),t||(e+=customizationIdMessage+customizationId),r||(e+="</li>"),customizationId&&($("#uploadable_files li div.customizationUploadBrowse img").remove(),$("#text_fields input").attr("value",""))}),r||(e+="</ul>",a.hasAttributes)||(e+="</dd>"),e},updateLayer:function(t){$("#layer_cart_product_title").text(t.name),$("#layer_cart_product_attributes").text(""),t.hasAttributes&&1==t.hasAttributes&&$("#layer_cart_product_attributes").html(t.attributes),$("#layer_cart_product_price").text(t.price),$("#layer_cart_product_quantity").text(t.quantity),$(".layer_cart_img").html('<img class="layer_cart_img img-responsive" src="'+t.image+'" alt="'+t.name+'" title="'+t.name+'" />');t=parseInt($(window).scrollTop())+"px";$(".layer_cart_overlay").css("width","100%"),$(".layer_cart_overlay").css("height","100%"),$(".layer_cart_overlay").show(),$("#layer_cart").css({top:t}).fadeIn("fast"),crossselling_serialScroll()},updateCart:function(t){if(t.hasError){var a="";for(error in t.errors)"indexOf"!=error&&(a+=$("<div />").html(t.errors[error]).text()+"\n");$.prototype.fancybox?$.fancybox.open([{type:"inline",autoScale:!0,minHeight:30,content:'<p class="fancybox-error">'+a+"</p>"}],{padding:0}):alert(a)}else ajaxCart.updateCartEverywhere(t),ajaxCart.hideOldProducts(t),ajaxCart.displayNewProducts(t),ajaxCart.refreshVouchers(t),$(".cart_block .products dt").removeClass("first_item").removeClass("last_item").removeClass("item"),$(".cart_block .products dt:first").addClass("first_item"),$(".cart_block .products dt:not(:first,:last)").addClass("item"),$(".cart_block .products dt:last").addClass("last_item")},updateCartEverywhere:function(t){$(".ajax_cart_total").text($.trim(t.productTotal)),"undefined"==typeof hasDeliveryAddress&&(hasDeliveryAddress=!1),0<parseFloat(t.shippingCostFloat)?$(".ajax_cart_shipping_cost").text(t.shippingCost).parent().find(".unvisible").show():(hasDeliveryAddress||"undefined"!=typeof orderProcess&&"order-opc"==orderProcess)&&"undefined"!=typeof freeShippingTranslation?$(".ajax_cart_shipping_cost").html(freeShippingTranslation):"undefined"==typeof toBeDetermined||hasDeliveryAddress||$(".ajax_cart_shipping_cost").html(toBeDetermined),t.shippingCostFloat||t.free_ship?hasDeliveryAddress&&!t.isVirtualCart&&$(".ajax_cart_shipping_cost").parent().find(".unvisible").show():$(".ajax_cart_shipping_cost").parent().find(".unvisible").hide(),$(".ajax_cart_tax_cost").text(t.taxCost),$(".cart_block_wrapping_cost").text(t.wrappingCost),$(".ajax_block_cart_total").text(t.total),$(".ajax_block_products_total").text(t.productTotal),$(".ajax_total_price_wt").text(t.total_price_wt),0<parseFloat(t.freeShippingFloat)?($(".ajax_cart_free_shipping").html(t.freeShipping),$(".freeshipping").fadeIn(0)):0==parseFloat(t.freeShippingFloat)&&$(".freeshipping").fadeOut(0),this.nb_total_products=t.nbTotalProducts,0<
1parseInt(t.nbTotalProducts)?($(".ajax_cart_no_product").hide(),$(".ajax_cart_quantity").text(t.nbTotalProducts),$(".ajax_cart_quantity").fadeIn("slow"),$(".ajax_cart_total").fadeIn("slow"),1<parseInt(t.nbTotalProducts)?($(".ajax_cart_product_txt").each(function(){$(this).hide()}),$(".ajax_cart_product_txt_s").each(function(){$(this).show()})):($(".ajax_cart_product_txt").each(function(){$(this).show()}),$(".ajax_cart_product_txt_s").each(function(){$(this).hide()}))):($(".ajax_cart_quantity, .ajax_cart_product_txt_s, .ajax_cart_product_txt, .ajax_cart_total").each(function(){$(this).hide()}),$(".ajax_cart_no_product").show("slow"))}};function HoverWatcher(t){this.hovering=!1;var a=this;this.isHoveringOver=function(){return a.hovering},$(t).hover(function(){a.hovering=!0},function(){a.hovering=!1})}function crossselling_serialScroll(){$.prototype.bxSlider&&$("#blockcart_caroucel").bxSlider({minSlides:2,maxSlides:4,slideWidth:178,slideMargin:20,moveSlides:1,infiniteLoop:!1,hideControlOnEnd:!0,pager:!1})}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.