Skip to content

Commit d365421

Browse files
committed
ACP2E-508: Switching to Arabic locale changes price to "0"
1 parent fc64721 commit d365421

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/code/Magento/Directory/Model/Currency.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,11 @@ private function formatCurrency(string $price, array $options): string
437437
$formattedCurrency = preg_replace('/ /u', '', $formattedCurrency, 1);
438438
}
439439

440+
if ((array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options)
441+
&& $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL)) {
442+
$formattedCurrency = str_replace(' ', '', $formattedCurrency);
443+
}
444+
440445
return preg_replace('/^\s+|\s+$/u', '', $formattedCurrency);
441446
}
442447

0 commit comments

Comments
 (0)