Skip to content

Commit 1f49196

Browse files
Merge branch 'fix/price-currency-negative' into release/1.24.1
2 parents f0b43af + 5368e88 commit 1f49196

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Service/Product/PriceData.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ public function formatPrice($price, array $config): string
321321
''
322322
);
323323

324-
// Append currency if configured.
325-
if ($useCurrency && $formattedPrice >= 0) {
324+
// Clamp negative prices to 0 and always append currency if configured.
325+
if ($useCurrency) {
326+
if ($formattedPrice < 0) {
327+
$formattedPrice = '0.00';
328+
}
326329
$formattedPrice .= ' ' . $currency;
327330
}
328331

0 commit comments

Comments
 (0)