fix price tax on product page add to cart box

This commit is contained in:
Marion Muszynski 2017-06-14 10:58:27 +02:00
parent fa50a0093b
commit 904f9865e7
3 changed files with 9 additions and 9 deletions

View File

@ -650,12 +650,11 @@ function confirmation(idProduct, idCombination, quantity, json) {
// AJOUT PANIER PAGE PRODUIT
if($('#quantity_sel').length > 0){
$('#quantity_sel').html(quantity);
if(quantity > 1){
var price = $('#price_add_to_cart').html();
var price_float = price.replace(",", ".");
var new_price = parseFloat(price_float) * quantity;
$('#price_add_to_cart').html(new_price);
}
var price = $('#our_price_display').html();
price = price.replace(' €','');
var price_float = price.replace(",", ".");
var new_price = parseFloat(price_float) * quantity;
$('#price_add_to_cart').html(String(new_price.toFixed(2)).replace('.',','));
$('.overlay_bbb').fadeIn();
$('.box_add_to_cart').fadeIn();
// send add product to cart information to GA

View File

@ -9,7 +9,7 @@ global $smarty;
$id_product = Tools::getValue('id_product', 0);
$idCombination = Tools::getValue('idCombination', 0);
if($id_product){
if($id_product){
$product = new Product($id_product, false, $cookie->id_lang);
$quantity = Tools::getValue('quantity', 1);
@ -39,7 +39,7 @@ if($id_product){
'img_dir' => '/themes/site/img/',
'quantity' => $quantity,
'bestSaleCart' => $bestSaleCart,
'price' => $price,
'price' => number_format($price, 2, ',', ''),
'delivery_delay' => (isset($delivery_delay) ? $delivery_delay : null)
));

View File

@ -337,7 +337,8 @@ function updateDisplay()
//productPrice = ps_round(productPrice * currencyRate, 2);
if (productPrice > 0){
$('#our_price_display').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank));
$('#price_add_to_cart').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank));
//$('#price_add_to_cart').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank));
$('#price_add_to_cart').text(String(productPrice.toFixed(2)).replace(".", ","));
}
else
$('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank));