Merge pull request #870 from djfm/development
[*] LO : Fixed a few bugs with currency formats in Back-Office orders
This commit is contained in:
@@ -656,11 +656,11 @@
|
||||
var id_product = Number(this.id_product);
|
||||
var id_product_attribute = Number(this.id_product_attribute);
|
||||
cart_quantity[Number(this.id_product)+'_'+Number(this.id_product_attribute)+'_'+Number(this.id_customization)] = this.cart_quantity;
|
||||
cart_content += '<tr><td><img src="'+this.image_link+'" title="'+this.name+'" /></td><td>'+this.name+'<br />'+this.attributes_small+'</td><td>'+this.reference+'</td><td><input type="text" size="7" rel="'+this.id_product+'_'+this.id_product_attribute+'" class="product_unit_price" value="' + formatCurrency(parseFloat(this.price.replace(',', '.')), currency_format, currency_sign, currency_blank) + '" /></td><td>';
|
||||
cart_content += '<tr><td><img src="'+this.image_link+'" title="'+this.name+'" /></td><td>'+this.name+'<br />'+this.attributes_small+'</td><td>'+this.reference+'</td><td><input type="text" size="7" rel="'+this.id_product+'_'+this.id_product_attribute+'" class="product_unit_price" value="' + formatCurrency(this.numeric_price, currency_format, currency_sign, currency_blank) + '" /></td><td>';
|
||||
cart_content += (!this.id_customization ? '<div style="float:left;"><a href="#" class="increaseqty_product" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" ><img src="../img/admin/up.gif" /></a><br /><a href="#" class="decreaseqty_product" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'"><img src="../img/admin/down.gif" /></a></div>' : '');
|
||||
cart_content += (!this.id_customization ? '<div style="float:left;"><input type="text" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" class="cart_quantity" size="2" value="'+this.cart_quantity+'" />' : '');
|
||||
cart_content += (!this.id_customization ? '<a href="#" class="delete_product" rel="delete_'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" ><img src="../img/admin/delete.gif" /></a></div>' : '');
|
||||
cart_content += '</td><td>' + formatCurrency(parseFloat(this.total.replace(',', '.')), currency_format, currency_sign, currency_blank) + '</td></tr>';
|
||||
cart_content += '</td><td>' + formatCurrency(this.numeric_total, currency_format, currency_sign, currency_blank) + '</td></tr>';
|
||||
|
||||
if (this.id_customization && this.id_customization != 0)
|
||||
{
|
||||
|
||||
@@ -551,6 +551,8 @@ class AdminCartsControllerCore extends AdminController
|
||||
if (count($summary['products']))
|
||||
foreach ($summary['products'] as &$product)
|
||||
{
|
||||
$product['numeric_price'] = $product['price'];
|
||||
$product['numeric_total'] = $product['total'];
|
||||
$product['price'] = str_replace($currency->sign, '', Tools::displayPrice($product['price'], $currency));
|
||||
$product['total'] = str_replace($currency->sign, '', Tools::displayPrice($product['total'], $currency));
|
||||
$product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small_default');
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
|
||||
if (currencyFormat == 4)
|
||||
return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign);
|
||||
if (currencyFormat == 5)
|
||||
return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign);
|
||||
return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '\'', '.'));
|
||||
return price;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
|
||||
if (currencyFormat == 4)
|
||||
return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign);
|
||||
if (currencyFormat == 5)
|
||||
return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign);
|
||||
return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '\'', '.'));
|
||||
return price;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user