// Fix bug with cart product price reload on changing delivery address

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15904 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-06-07 09:12:28 +00:00
parent d7e4fcde55
commit 955fb96d0e
4 changed files with 35 additions and 4 deletions
+1 -3
View File
@@ -543,9 +543,7 @@ function updateCartSummary(json)
initial_price_text = '<span style="text-decoration:line-through;">'+initial_price+'</span><br />';
}
key_for_blockcart = json.products[i].id_product+'_'+json.products[i].id_product_attribute;
if (json.products[i].id_product_attribute == 0)
key_for_blockcart = json.products[i].id_product;
key_for_blockcart = json.products[i].id_product+'_'+json.products[i].id_product_attribute+'_'+json.products[i].id_address_delivery;
$('#cart_block_product_'+key_for_blockcart+' span.quantity').html(json.products[i].cart_quantity);
+32
View File
@@ -73,6 +73,38 @@ function updateAddressSelection()
}
else
{
// Update all product keys with the new address id
$('#cart_summary .address_'+deliveryAddress).each(function() {
$(this)
.removeClass('address_'+deliveryAddress)
.addClass('address_'+idAddress_delivery);
if ($(this).find('.cart_unit span').length > 0 && $(this).find('.cart_unit span').attr('id').length > 0)
$(this).find('.cart_unit span').attr('id', $(this).find('.cart_unit span').attr('id').replace(/_\d+$/, '_'+idAddress_delivery));
if ($(this).find('.cart_total span').length > 0 && $(this).find('.cart_total span').attr('id').length > 0)
$(this).find('.cart_total span').attr('id', $(this).find('.cart_total span').attr('id').replace(/_\d+$/, '_'+idAddress_delivery));
if ($(this).find('.cart_quantity_input').length > 0 && $(this).find('.cart_quantity_input').attr('name').length > 0)
{
name = $(this).find('.cart_quantity_input').attr('name')+'_hidden';
$(this).find('.cart_quantity_input').attr('name', $(this).find('.cart_quantity_input').attr('name').replace(/_\d+$/, '_'+idAddress_delivery));
if ($(this).find('[name='+name+']')> 0)
$(this).find('[name='+name+']').attr('name', name.replace(/_\d+_hidden$/, '_'+idAddress_delivery+'_hidden'));
}
if ($(this).find('.cart_quantity_delete').length > 0 && $(this).find('.cart_quantity_delete').attr('id').length > 0) {
$(this).find('.cart_quantity_delete')
.attr('id', $(this).find('.cart_quantity_delete').attr('id').replace(/_\d+$/, '_'+idAddress_delivery))
.attr('href', $(this).find('.cart_quantity_delete').attr('href').replace(/id_address_delivery=\d+&/, 'id_address_delivery='+idAddress_delivery+'&'))
}
});
// Update global var deliveryAddress
deliveryAddress = idAddress_delivery;
updateCarrierList(jsonData.carrier_data);
updatePaymentMethods(jsonData);
updateCartSummary(jsonData.summary);