[-] FO: Fix PSCFV-4078

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17458 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-09-21 13:06:53 +00:00
parent 2897c024ce
commit 4dac4d9609
4 changed files with 54 additions and 20 deletions
+3 -5
View File
@@ -538,12 +538,11 @@ function updateCartSummary(json)
return;
$('.cart_quantity_input').val(0);
product_list = {};
for (i=0;i<json.products.length;i++)
{
product_list[json.products[i].id_product+'_'+json.products[i].id_product_attribute+'_'+json.products[i].id_address_delivery] = json.products[i];
}
if (!$('.multishipping-cart:visible').length)
{
for (i=0;i<json.gift_products.length;i++)
@@ -560,7 +559,7 @@ function updateCartSummary(json)
product_list[json.gift_products[i].id_product+'_'+json.gift_products[i].id_product_attribute+'_'+json.gift_products[i].id_address_delivery] = json.gift_products[i];
}
}
for (i in product_list)
{
// if reduction, we need to show it in the cart by showing the initial price above the current one
@@ -598,7 +597,6 @@ function updateCartSummary(json)
}
nbrProducts += parseInt(product_list[i].quantity);
$('input[name=quantity_'+product_list[i].id_product+'_'+product_list[i].id_product_attribute+'_0_'+product_list[i].id_address_delivery+']').val(product_list[i].quantity_without_customization);
$('input[name=quantity_'+product_list[i].id_product+'_'+product_list[i].id_product_attribute+'_0_'+product_list[i].id_address_delivery+'_hidden]').val(product_list[i].quantity_without_customization);
+16 -5
View File
@@ -48,7 +48,7 @@ function updateAddressSelection()
{
var idAddress_delivery = ($('input#opc_id_address_delivery').length == 1 ? $('input#opc_id_address_delivery').val() : $('#id_address_delivery').val());
var idAddress_invoice = ($('input#opc_id_address_invoice').length == 1 ? $('input#opc_id_address_invoice').val() : ($('input[type=checkbox]#addressesAreEquals:checked').length == 1 ? idAddress_delivery : ($('#id_address_invoice').length == 1 ? $('select#id_address_invoice').val() : idAddress_delivery)));
$('#opc_account-overlay').fadeIn('slow');
$('#opc_delivery_methods-overlay').fadeIn('slow');
$('#opc_payment_methods-overlay').fadeIn('slow');
@@ -78,7 +78,7 @@ function updateAddressSelection()
$(this)
.removeClass('address_'+deliveryAddress)
.addClass('address_'+idAddress_delivery);
$(this).attr('id', $(this).attr('id').replace(/_\d+$/, '_'+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));
@@ -88,10 +88,8 @@ function updateAddressSelection()
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)
if ($(this).find('[name='+name+']').length > 0)
$(this).find('[name='+name+']').attr('name', name.replace(/_\d+_hidden$/, '_'+idAddress_delivery+'_hidden'));
}
@@ -100,6 +98,19 @@ function updateAddressSelection()
.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+'&'))
}
if ($(this).find('.cart_quantity_down').length > 0 && $(this).find('.cart_quantity_down').attr('id').length > 0) {
$(this).find('.cart_quantity_down')
.attr('id', $(this).find('.cart_quantity_down').attr('id').replace(/_\d+$/, '_'+idAddress_delivery))
.attr('href', $(this).find('.cart_quantity_down').attr('href').replace(/id_address_delivery=\d+&/, 'id_address_delivery='+idAddress_delivery+'&'))
}
if ($(this).find('.cart_quantity_up').length > 0 && $(this).find('.cart_quantity_up').attr('id').length > 0) {
$(this).find('.cart_quantity_up')
.attr('id', $(this).find('.cart_quantity_up').attr('id').replace(/_\d+$/, '_'+idAddress_delivery))
.attr('href', $(this).find('.cart_quantity_up').attr('href').replace(/id_address_delivery=\d+&/, 'id_address_delivery='+idAddress_delivery+'&'))
}
});
// Update global var deliveryAddress