Skip to main content

Currency conversion

More
12 years 9 months ago #137368 by ghiamar
Currency conversion was created by ghiamar
Hi, does hikashop have some currency conversion functions?

I need to convert from currency ID to another currency ID.

Thanks in advise!

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #137371 by Jerome
Replied by Jerome on topic Currency conversion
Hi,

www.hikashop.com/support/integrated-docu...ency-form.html#infos

Rate : The rate of the currency based on the main currency set in the configuration page. The main currency will always have a rate of 1. As you can see, on this screenshot, the main currency is Euro.


Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #137385 by ghiamar
Replied by ghiamar on topic Currency conversion
Sorry, I didn't express myself well...I need to convert currencyes to an payment accepted currency...

Just done with this little snippet
Code:
$app = JFactory::getApplication(); $currencyClass = hikashop_get('class.currency'); $paymentCurrencyId = $currencyClass->get($this->payment_params->payment_currency)->currency_id; $orderCurrencyId = (int)$app->getUserState(HIKASHOP_COMPONENT.'.currency_id', $currencyClass->mainCurrency()); $totalInPaymentCurrency = $currencyClass->convertUniquePrice(round($order->cart->full_total->prices[0]->price_value_with_tax, (int)$this->currency->currency_locale['int_frac_digits']), $orderCurrencyId, $paymentCurrencyId);

Best regards!

Please Log in or Create an account to join the conversation.

Time to create page: 0.215 seconds
Powered by Kunena Forum