Skip to content

Commit

Permalink
Merge pull request PrestaShop#19601 from ksaandev/patch-3
Browse files Browse the repository at this point in the history
Only use unit_price_ratio when defined in Product
  • Loading branch information
PierreRambaud authored Jun 15, 2020
2 parents 8fe95f0 + 4aef3e9 commit 21aa532
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -5536,7 +5536,11 @@ public static function getProductProperties($id_lang, $row, Context $context = n
$row['unit_price_ratio'] = $row['price_tax_exc'] / $unitPrice;
}

$row['unit_price'] = ($row['unit_price_ratio'] != 0 ? $row['price'] / $row['unit_price_ratio'] : 0);
if (isset($row['unit_price_ratio'])) {
$row['unit_price'] = ($row['unit_price_ratio'] != 0 ? $row['price'] / $row['unit_price_ratio'] : 0);
} else {
$row['unit_price'] = 0.0;
}

self::$productPropertiesCache[$cache_key] = $row;

Expand Down

0 comments on commit 21aa532

Please sign in to comment.