@@ -401,7 +401,7 @@ private function formatCurrency(string $price, array $options): string
401
401
'currency_display_options_forming ' ,
402
402
['currency_options ' => $ customerOptions , 'base_code ' => $ this ->getCode ()]
403
403
);
404
- $ options = array_merge ( $ options , $ customerOptions ->toArray () );
404
+ $ options += $ customerOptions ->toArray ();
405
405
406
406
$ this ->numberFormatter = $ this ->numberFormatterFactory ->create (
407
407
['locale ' => $ this ->localeResolver ->getLocale (), 'style ' => \NumberFormatter::CURRENCY ]
@@ -413,8 +413,9 @@ private function formatCurrency(string $price, array $options): string
413
413
$ price , $ this ->getCode () ?? $ this ->numberFormatter ->getTextAttribute (\NumberFormatter::CURRENCY_CODE )
414
414
);
415
415
416
- if (array_key_exists (LocaleCurrency::CURRENCY_OPTION_DISPLAY , $ options )
417
- && $ options [LocaleCurrency::CURRENCY_OPTION_DISPLAY ] === \Magento \Framework \Currency::NO_SYMBOL ) {
416
+ if ((array_key_exists (LocaleCurrency::CURRENCY_OPTION_DISPLAY , $ options )
417
+ && $ options [LocaleCurrency::CURRENCY_OPTION_DISPLAY ] === \Magento \Framework \Currency::NO_SYMBOL )
418
+ || array_key_exists (LocaleCurrency::CURRENCY_OPTION_SYMBOL , $ options )) {
418
419
$ formattedCurrency = str_replace (' ' , '' , $ formattedCurrency );
419
420
}
420
421
@@ -429,18 +430,18 @@ private function formatCurrency(string $price, array $options): string
429
430
*/
430
431
private function setOptions (array $ options ): void
431
432
{
433
+ if (array_key_exists (LocaleCurrency::CURRENCY_OPTION_SYMBOL , $ options )) {
434
+ $ this ->numberFormatter ->setSymbol (
435
+ \NumberFormatter::CURRENCY_SYMBOL , $ options [LocaleCurrency::CURRENCY_OPTION_SYMBOL ]
436
+ );
437
+ }
432
438
if (array_key_exists (LocaleCurrency::CURRENCY_OPTION_DISPLAY , $ options )
433
439
&& $ options [LocaleCurrency::CURRENCY_OPTION_DISPLAY ] === \Magento \Framework \Currency::NO_SYMBOL ) {
434
440
$ this ->numberFormatter ->setSymbol (\NumberFormatter::CURRENCY_SYMBOL , '' );
435
441
}
436
442
if (array_key_exists ('precision ' , $ options )) {
437
443
$ this ->numberFormatter ->setAttribute (\NumberFormatter::FRACTION_DIGITS , $ options ['precision ' ]);
438
444
}
439
- if (array_key_exists (LocaleCurrency::CURRENCY_OPTION_SYMBOL , $ options )) {
440
- $ this ->numberFormatter ->setSymbol (
441
- \NumberFormatter::CURRENCY_SYMBOL , $ options [LocaleCurrency::CURRENCY_OPTION_SYMBOL ]
442
- );
443
- }
444
445
}
445
446
446
447
/**
0 commit comments