Ejemplo n.º 1
0
 public function viewAdminParams()
 {
     $currencies = allCurrencies();
     foreach ($currencies as $currencyCode => $currency) {
         if (!isset($this->exchangeRates[$currencyCode]) || $currencyCode == $this->mainCurrencyCode) {
             $this->exchangeRates[$currencyCode] = 1;
         }
     }
     return array_merge(parent::viewAdminParams(), ['exchange_rates' => $this->exchangeRates, 'main_currency_code' => $this->mainCurrencyCode, 'currencies' => allCurrencies()]);
 }
Ejemplo n.º 2
0
function currenciesAsOptions($selected_currency = 'VND')
{
    $options = '';
    foreach (allCurrencies() as $code => $properties) {
        $options .= '<option value="' . $code . '"' . ($selected_currency == $code ? ' selected' : '') . '>' . $properties['name'] . ' (' . $properties['symbol'] . ')' . '</option>';
    }
    return $options;
}