File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
lib/internal/Magento/Framework/Setup Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments