Skip to content

Commit

Permalink
CO: fixed undefined real value in ProductController (PrestaShop#5996)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelandrieu authored Aug 11, 2016
1 parent a223714 commit 48ef90c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/front/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,9 @@ protected function formatQuantityDiscounts($specific_prices, $price, $tax_rate,
} else {
$cur_price *= 1 - $row['reduction'];
}
$row['real_value'] = $price > 0 ? $price - $cur_price : $cur_price;
$discountPrice = $price - $row['real_value'];

if (Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')) {
if ($row['reduction_tax'] == 0 && !$row['price']) {
$row['discount'] = $priceFormatter->convertAndFormat($price - ($price * $row['reduction_with_tax']));
Expand All @@ -714,7 +716,6 @@ protected function formatQuantityDiscounts($specific_prices, $price, $tax_rate,
} else {
$row['discount'] = $priceFormatter->convertAndFormat($row['real_value']);
}
$row['real_value'] = $price > 0 ? $price - $cur_price : $cur_price;
} else {
if ($row['reduction_type'] == 'amount') {
if (Product::$_taxCalculationMethod == PS_TAX_INC) {
Expand Down

0 comments on commit 48ef90c

Please sign in to comment.