Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 3293254

Browse files
r-martinsnmalevanec
authored andcommitted
Remove non-allowed currencies from the currencies dropdown in the Magento Setup
1 parent c166940 commit 3293254

File tree

1 file changed

+12
-0
lines changed
  • lib/internal/Magento/Framework/Setup

1 file changed

+12
-0
lines changed

lib/internal/Magento/Framework/Setup/Lists.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ class Lists
2121
*/
2222
protected $allowedLocales;
2323

24+
/**
25+
* List of allowed currencies
26+
*
27+
* @var array
28+
*/
29+
protected $allowedCurrencies;
30+
2431
/**
2532
* @param ConfigInterface $localeConfig
2633
*/
2734
public function __construct(ConfigInterface $localeConfig)
2835
{
2936
$this->allowedLocales = $localeConfig->getAllowedLocales();
37+
$this->allowedCurrencies = $localeConfig->getAllowedCurrencies();
3038
}
3139

3240
/**
@@ -64,6 +72,10 @@ public function getCurrencyList()
6472
$currencies = (new CurrencyBundle())->get(Resolver::DEFAULT_LOCALE)['Currencies'];
6573
$list = [];
6674
foreach ($currencies as $code => $data) {
75+
$isAllowedCurrency = array_search($code, $this->allowedCurrencies) !== false;
76+
if (!$isAllowedCurrency) {
77+
continue;
78+
}
6779
$list[$code] = $data[1] . ' (' . $code . ')';
6880
}
6981
asort($list);

0 commit comments

Comments
 (0)