kronoszx
12/13/2019 - 2:22 PM

Price Problem product Page Rounded Error 1.6

// classes/Tools.php

:816
- public static function convertPriceFull($amount, Currency $currency_from = null, Currency $currency_to = null)
+ public static function convertPriceFull($amount, Currency $currency_from = null, Currency $currency_to = null, $round = true)

:839
- return Tools::ps_round($amount, _PS_PRICE_COMPUTE_PRECISION_);
+ if ($round) {
+  	$amount = Tools::ps_round($amount, _PS_PRICE_COMPUTE_PRECISION_);
+ }
+ return $amount;
// controllers/front/ProductController.php

:456
- $combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPriceFull($row['price'], null, Context::getContext()->currency);
+ $combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPriceFull($row['price'], null, Context::getContext()->currency, false);

:468
- $combinations[$row['id_product_attribute']]['unit_impact'] = Tools::convertPriceFull($row['unit_price_impact'], null, Context::getContext()->currency);
+ $combinations[$row['id_product_attribute']]['unit_impact'] = Tools::convertPriceFull($row['unit_price_impact'], null, Context::getContext()->currency, false);
// js/admin/product.js

::451
-	getE('attribute_price').value = ps_round(Math.abs(price_impact), 2);
+	getE('attribute_price').value = ps_round(Math.abs(price_impact), 6);