Merge branch 'ticket-11784-QtyInShoppingCart' into develop
This commit is contained in:
commit
b8e6780110
@ -131,7 +131,7 @@ function deletProductFromSummary(id)
|
||||
});
|
||||
}
|
||||
|
||||
function updateLayerDelay()
|
||||
function updateLayerDelay()
|
||||
{
|
||||
$('.delivery_delay_cart').each(function(index){
|
||||
var line = $(this).next('tr').next('tr');
|
||||
@ -257,48 +257,49 @@ function updateCartSummary(json)
|
||||
var i;
|
||||
var nbrProducts = 0;
|
||||
|
||||
if (typeof json == 'undefined')
|
||||
return;
|
||||
if (typeof json == 'undefined')
|
||||
return;
|
||||
|
||||
for (i=0;i<json.products.length;i++)
|
||||
{
|
||||
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;
|
||||
$.each(json.products, function(key, json2) {
|
||||
for (i=0;i<json2.products.length;i++)
|
||||
{
|
||||
key_for_blockcart = json2.products[i].id_product+'_'+json2.products[i].id_product_attribute;
|
||||
if (json2.products[i].id_product_attribute == 0)
|
||||
key_for_blockcart = json2.products[i].id_product;
|
||||
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.quantity').html(json.products[i].cart_quantity);
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.quantity').html(json2.products[i].cart_quantity);
|
||||
|
||||
if (priceDisplayMethod != 0)
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].price, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].price_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
if (priceDisplayMethod != 0)
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json2.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].price, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json2.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].price_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
|
||||
nbrProducts += parseInt(json.products[i].cart_quantity);
|
||||
nbrProducts += parseInt(json2.products[i].cart_quantity);
|
||||
if(json2.products[i].id_customization == null)
|
||||
{
|
||||
$('input[name=quantity_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')+']').val(json2.products[i].cart_quantity);
|
||||
$('input[name=quantity_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')+'_hidden]').val(json2.products[i].cart_quantity);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_quantity_custom_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(json2.products[i].cart_quantity);
|
||||
}
|
||||
|
||||
if(json.products[i].id_customization == null)
|
||||
{
|
||||
$('input[name=quantity_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')+']').val(json.products[i].cart_quantity);
|
||||
$('input[name=quantity_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')+'_hidden]').val(json.products[i].cart_quantity);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_quantity_custom_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(json.products[i].cart_quantity);
|
||||
}
|
||||
|
||||
// Show / hide quantity button if minimal quantity
|
||||
if (parseInt(json.products[i].minimal_quantity) == parseInt(json.products[i].cart_quantity) && json.products[i].minimal_quantity != 1)
|
||||
$('#cart_quantity_down_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')).fadeTo('slow',0.3);
|
||||
else
|
||||
$('#cart_quantity_down_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')).fadeTo('slow',1);
|
||||
}
|
||||
// Show / hide quantity button if minimal quantity
|
||||
if (parseInt(json2.products[i].minimal_quantity) == parseInt(json2.products[i].cart_quantity) && json2.products[i].minimal_quantity != 1)
|
||||
$('#cart_quantity_down_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')).fadeTo('slow',0.3);
|
||||
else
|
||||
$('#cart_quantity_down_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')).fadeTo('slow',1);
|
||||
}
|
||||
});
|
||||
|
||||
// Update discounts
|
||||
if (json.discounts.length == 0)
|
||||
|
@ -247,46 +247,47 @@ function updateCartSummary(json)
|
||||
|
||||
if (typeof json == 'undefined')
|
||||
return;
|
||||
$.each(json.products, function(key, json2) {
|
||||
for (i=0;i<json2.products.length;i++)
|
||||
{
|
||||
key_for_blockcart = json2.products[i].id_product+'_'+json2.products[i].id_product_attribute;
|
||||
if (json2.products[i].id_product_attribute == 0)
|
||||
key_for_blockcart = json2.products[i].id_product;
|
||||
|
||||
for (i=0;i<json.products.length;i++)
|
||||
{
|
||||
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;
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.quantity').html(json2.products[i].cart_quantity);
|
||||
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.quantity').html(json.products[i].cart_quantity);
|
||||
if (priceDisplayMethod != 0)
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json2.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].price, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json2.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].price_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(formatCurrency(json2.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
|
||||
if (priceDisplayMethod != 0)
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].price, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].total, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_block_product_'+key_for_blockcart+' span.price').html(formatCurrency(json.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].price_wt, currencyFormat, currencySign, currencyBlank));
|
||||
$('#total_product_price_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(formatCurrency(json.products[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
nbrProducts += parseInt(json2.products[i].cart_quantity);
|
||||
|
||||
nbrProducts += parseInt(json.products[i].cart_quantity);
|
||||
if(json2.products[i].id_customization == null)
|
||||
{
|
||||
$('input[name=quantity_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')+']').val(json2.products[i].cart_quantity);
|
||||
$('input[name=quantity_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')+'_hidden]').val(json2.products[i].cart_quantity);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_quantity_custom_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute).html(json2.products[i].cart_quantity);
|
||||
}
|
||||
|
||||
if(json.products[i].id_customization == null)
|
||||
{
|
||||
$('input[name=quantity_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')+']').val(json.products[i].cart_quantity);
|
||||
$('input[name=quantity_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')+'_hidden]').val(json.products[i].cart_quantity);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cart_quantity_custom_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute).html(json.products[i].cart_quantity);
|
||||
}
|
||||
|
||||
// Show / hide quantity button if minimal quantity
|
||||
if (parseInt(json.products[i].minimal_quantity) == parseInt(json.products[i].cart_quantity) && json.products[i].minimal_quantity != 1)
|
||||
$('#cart_quantity_down_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')).fadeTo('slow',0.3);
|
||||
else
|
||||
$('#cart_quantity_down_'+json.products[i].id_product+'_'+json.products[i].id_product_attribute+(json.products[i].id_customization != null ? '_'+json.products[i].id_customization : '')).fadeTo('slow',1);
|
||||
}
|
||||
// Show / hide quantity button if minimal quantity
|
||||
if (parseInt(json2.products[i].minimal_quantity) == parseInt(json2.products[i].cart_quantity) && json2.products[i].minimal_quantity != 1)
|
||||
$('#cart_quantity_down_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')).fadeTo('slow',0.3);
|
||||
else
|
||||
$('#cart_quantity_down_'+json2.products[i].id_product+'_'+json2.products[i].id_product_attribute+(json2.products[i].id_customization != null ? '_'+json2.products[i].id_customization : '')).fadeTo('slow',1);
|
||||
}
|
||||
});
|
||||
|
||||
// Update discounts
|
||||
if (json.discounts.length == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user