Skip to content

Commit f59beed

Browse files
committed
ACP2E-1012: No space between a custom currency symbol and a price
1 parent 828d086 commit f59beed

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ class Currencysymbol
2727
protected $_symbolsData = [];
2828

2929
/**
30+
* Store id
31+
*
3032
* @var string|null
3133
*/
3234
protected $_storeId;
3335

3436
/**
37+
* Website id
38+
*
3539
* @var string|null
3640
*/
3741
protected $_websiteId;
@@ -51,19 +55,19 @@ class Currencysymbol
5155
/**
5256
* Config path to custom currency symbol value
5357
*/
54-
public const XML_PATH_CUSTOM_CURRENCY_SYMBOL = 'currency/options/customsymbol';
58+
const XML_PATH_CUSTOM_CURRENCY_SYMBOL = 'currency/options/customsymbol';
5559

56-
public const XML_PATH_ALLOWED_CURRENCIES = \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_ALLOW;
60+
const XML_PATH_ALLOWED_CURRENCIES = \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_ALLOW;
5761

5862
/*
5963
* Separator used in config in allowed currencies list
6064
*/
61-
public const ALLOWED_CURRENCIES_CONFIG_SEPARATOR = ',';
65+
const ALLOWED_CURRENCIES_CONFIG_SEPARATOR = ',';
6266

6367
/**
6468
* Config currency section
6569
*/
66-
public const CONFIG_SECTION = 'currency';
70+
const CONFIG_SECTION = 'currency';
6771

6872
/**
6973
* Core event manager proxy
@@ -288,7 +292,7 @@ protected function _unserializeStoreConfig($configPath, $storeId = null)
288292
*/
289293
protected function getAllowedCurrencies()
290294
{
291-
$allowedCurrencies = [];
295+
$allowedCurrencies = [[]];
292296
$allowedCurrencies[] = explode(
293297
self::ALLOWED_CURRENCIES_CONFIG_SEPARATOR,
294298
$this->_scopeConfig->getValue(
@@ -326,6 +330,6 @@ protected function getAllowedCurrencies()
326330
}
327331
}
328332
}
329-
return array_unique(array_merge([], ...$allowedCurrencies));
333+
return array_unique(array_merge(...$allowedCurrencies));
330334
}
331335
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ private function formatCurrency(string $price, array $options): string
437437
$formattedCurrency = preg_replace('/( |&nbsp|\xc2\xa0)*/iu', '', $formattedCurrency);
438438

439439
if (!array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options)) {
440-
// remove any space from intl supported custom currency symbol in formatted currency
440+
// remove non-breaking space from intl supported custom currency symbols in formatted currency
441441
$formattedCurrency = str_replace(' ', '', $formattedCurrency);
442442
}
443443
}

0 commit comments

Comments
 (0)