Пример #1
0
 /**
  * Retrieve array of allowed currencies
  *
  * @return array
  */
 protected function _getAllowedCurrencies()
 {
     if ($this->_appState->isInstalled()) {
         $allowed = $this->_scopeResolver->getScope()->getAllowedCurrencies();
     } else {
         $allowed = $this->_config->getAllowedCurrencies();
     }
     return $allowed;
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function getOptionCurrencies()
 {
     $currencies = $this->getTranslationList('currencytoname');
     $options = array();
     $allowed = $this->_config->getAllowedCurrencies();
     foreach ($currencies as $name => $code) {
         if (!in_array($code, $allowed)) {
             continue;
         }
         $options[] = array('label' => $name, 'value' => $code);
     }
     return $this->_sortOptionArray($options);
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function getOptionCurrencies()
 {
     $currencies = (new CurrencyBundle())->get($this->localeResolver->getLocale())['Currencies'] ?: [];
     $options = [];
     $allowed = $this->_config->getAllowedCurrencies();
     foreach ($currencies as $code => $data) {
         if (!in_array($code, $allowed)) {
             continue;
         }
         $options[] = ['label' => $data[1], 'value' => $code];
     }
     return $this->_sortOptionArray($options);
 }