From a876b13c1c6fe357e3192ef15e447d859f1132dc Mon Sep 17 00:00:00 2001
From: Damien Metzger '+this.name+'
'+this.attributes_small+''+this.reference+' ';
+ cart_content += ' ';
+ cart_content += ''+this.name+'
'+this.attributes_small+''+this.reference+' ';
cart_content += (!this.id_customization ? '' : '');
cart_content += (!this.id_customization ? '' : '');
- cart_content += ' '+this.total+' ' + formatCurrency(parseFloat(this.total), currency_format, currency_sign, currency_blank) + ' ';
+
if (this.id_customization && this.id_customization != 0)
{
$.each(this.customized_datas[this.id_product][this.id_product_attribute][id_address_delivery], function() {
@@ -712,6 +717,11 @@
function displaySummary(jsonSummary)
{
+ currency_format = jsonSummary.currency.format;
+ currency_sign = jsonSummary.currency.sign;
+ currency_blank = jsonSummary.currency.blank;
+ priceDisplayPrecision = jsonSummary.currency.decimals ? 2 : 0;
+
updateCartProducts(jsonSummary.summary.products, jsonSummary.summary.gift_products, jsonSummary.cart.id_address_delivery);
updateCartVouchers(jsonSummary.summary.discounts);
updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice);
@@ -738,19 +748,18 @@
$('#gift_message').html(jsonSummary.cart.gift_message);
if(!changed_shipping_price)
- $('#shipping_price').html(''+jsonSummary.summary.total_shipping+'');
+ $('#shipping_price').html('' + formatCurrency(parseFloat(jsonSummary.summary.total_shipping), currency_format, currency_sign, currency_blank) + '');
shipping_price_selected_carrier = jsonSummary.summary.total_shipping;
-
- $('#total_vouchers').html(jsonSummary.summary.total_discounts_tax_exc);
- $('#total_shipping').html(jsonSummary.summary.total_shipping_tax_exc);
- $('#total_taxes').html(jsonSummary.summary.total_tax);
- $('#total_without_taxes').html(jsonSummary.summary.total_price_without_tax);
- $('#total_with_taxes').html(jsonSummary.summary.total_price);
- $('#total_products').html(jsonSummary.summary.total_products);
+
+ $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank));
+ $('#total_shipping').html(formatCurrency(parseFloat(jsonSummary.summary.total_shipping_tax_exc), currency_format, currency_sign, currency_blank));
+ $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank));
+ $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax), currency_format, currency_sign, currency_blank));
+ $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank));
+ $('#total_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_products), currency_format, currency_sign, currency_blank));
id_currency = jsonSummary.cart.id_currency;
$('#id_currency option').removeAttr('selected');
$('#id_currency option[value="'+id_currency+'"]').attr('selected', true);
- updateCurrencySign();
id_lang = jsonSummary.cart.id_lang;
$('#id_lang option').removeAttr('selected');
$('#id_lang option[value="'+id_lang+'"]').attr('selected', true);
@@ -778,21 +787,21 @@
qty: qty,
id_customer: id_customer,
id_cart: id_cart,
- },
+ },
success : function(res)
{
- displaySummary(res);
- var errors = '';
- if(res.errors.length)
- {
- $.each(res.errors, function() {
- errors += this+'
';
- });
- $('#products_err').show();
- }
- else
- $('#products_err').hide();
- $('#products_err').html(errors);
+ displaySummary(res);
+ var errors = '';
+ if (res.errors.length)
+ {
+ $.each(res.errors, function() {
+ errors += this + '
';
+ });
+ $('#products_err').show();
+ }
+ else
+ $('#products_err').hide();
+ $('#products_err').html(errors);
}
});
}
@@ -888,11 +897,6 @@
});
}
- function updateCurrencySign()
- {
- $('.currency_sign').html(currencies[id_currency]);
- }
-
function sendMailToCustomer()
{
$.ajax({
@@ -1184,7 +1188,7 @@
- +
@@ -1208,12 +1212,12 @@