From 6bd6f283a579daf920cc275276dd2b43e07b65a9 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 11 Mar 2013 12:35:23 +0100 Subject: [PATCH] [-] FO : Fix bug #PSCFV-7946 delete customized product with several custos --- modules/blockcart/ajax-cart.js | 21 ++++++++-------- themes/default/css/product.css | 5 +++- themes/default/js/cart-summary.js | 40 ++++++++++++++----------------- themes/default/js/order-opc.js | 24 +++++++++---------- 4 files changed, 44 insertions(+), 46 deletions(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index a15000549..307bc301c 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -52,11 +52,8 @@ var ajaxCart = { var customizationId = 0; var productId = 0; var productAttributeId = 0; - if ($($(this).parent().parent()).attr('name') == 'customization') - // Reverse two levels: a >> div >> li - var customizableProductDiv = $($(this).parent().parent()).find("div[id^=deleteCustomizableProduct_]"); - else - var customizableProductDiv = $($(this).parent()).find("div[id^=deleteCustomizableProduct_]"); + var customizableProductDiv = $($(this).parent().parent()).find("div[id^=deleteCustomizableProduct_]"); + if (customizableProductDiv && $(customizableProductDiv).length) { $(customizableProductDiv).each(function(){ @@ -185,7 +182,7 @@ var ajaxCart = { return ; } emptyCustomizations(); - //disabled the button when adding to do not double add if user double click + //disabled the button when adding to not double add if user double click if (addedFromProductPage) { $('#add_to_cart input').attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled'); @@ -466,9 +463,10 @@ var ajaxCart = { //else update the product's line else { - var jsonProduct = this; - if($('#cart_block_product_' + domIdProduct + ' .quantity').text() != jsonProduct.quantity || $('dt#cart_block_product_' + domIdProduct + ' .price').text() != jsonProduct.priceByLine) + var jsonProduct = this; + if($.trim($('#cart_block_product_' + domIdProduct + ' .quantity').text()) != jsonProduct.quantity || $.trim($('dt#cart_block_product_' + domIdProduct + ' .price').text()) != jsonProduct.priceByLine) { + // Usual product if (!this.is_gift) $('#cart_block_product_' + domIdProduct + ' .price').text(jsonProduct.priceByLine); @@ -521,11 +519,12 @@ var ajaxCart = { content += '