public function getInput() { require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/currencies.php'; $model = new J2StoreModelCurrencies(); $currencies = $model->getCurrencies(); //generate country filter list $currency_options = array(); foreach ($currencies as $row) { $currency_options[] = JHTML::_('select.option', $row->currency_code, $row->currency_title); } return JHTML::_('select.genericlist', $currency_options, $this->name, 'onchange=', 'value', 'text', $this->value); }
function _updateCurrency() { $session = JFactory::getSession(); //if auto update currency is set, then call the update function $store_config = J2StoreHelperCart::getStoreAddress(); //session based check. We dont want to update currency when we load each and every item. if ($store_config->config_currency_auto && !$session->has('currency_updated', 'j2store')) { require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/currencies.php'; $currency_model = new J2StoreModelCurrencies(); $currency_model->updateCurrencies(); $session->set('currency_updated', '1', 'j2store'); } }