Fixed Notification Format Price (#884)

Fixed notification formatPrice which would blindly remove the 4th character
Ensure there is a space between the Symbol and the Value
This commit is contained in:
Louis
2025-07-28 12:49:43 +02:00
committed by GitHub
parent bff79a1940
commit f51420799d

View File

@@ -41,9 +41,9 @@ function formatPrice($price, $currencyCode, $currencySymbol)
{
$formattedPrice = CurrencyFormatter::format($price, $currencyCode);
if (strstr($formattedPrice, $currencyCode)) {
$formattedPrice = str_replace($currencyCode, $currencySymbol, $formattedPrice);
$formattedPrice = substr_replace($formattedPrice, "", 3, 1);
if (strpos($formattedPrice, $currencyCode) !== false) {
$formattedPrice = str_replace($currencyCode, $currencySymbol . ' ', $formattedPrice);
$formattedPrice = preg_replace('/\s+/', ' ', $formattedPrice);
}
return $formattedPrice;