Hi
We like the "Auto Update Currency" feature, but we have a slight problem with it, our local currency is GBP, but we sell a lot of items throughout Europe, so offering Euro rates helps our customers, but the rate that open cart uses on a daily basis differs from the exchange rate that PayPal (our merchant gateway) offer to exchange the Euros back into GBP.
Is there a way to bring the two rates in line, or change the update source for opencart to be the same as PayPal?
We like the "Auto Update Currency" feature, but we have a slight problem with it, our local currency is GBP, but we sell a lot of items throughout Europe, so offering Euro rates helps our customers, but the rate that open cart uses on a daily basis differs from the exchange rate that PayPal (our merchant gateway) offer to exchange the Euros back into GBP.
Is there a way to bring the two rates in line, or change the update source for opencart to be the same as PayPal?
At line 131 of admin/model/localisation/currency.php you find the value returned by finance.yahoo.com :
Result:
For instance:
1 GBP = 1.1688 EUR
After calculation:
1 GBP = 1,13586 EUR
Code: Select all
$value = utf8_substr($line, 11, 6);
After that you could substract the 2.9% Paypal takes as provision.GBPEUR=X,1.1688
GBPUSD=X,1.5131
Code: Select all
$value = ( $value / 102.9 * 100 );
1 GBP = 1.1688 EUR
After calculation:
1 GBP = 1,13586 EUR
this is what i have added, am i right?
Code: Select all
foreach ($lines as $line) {
$currency = utf8_substr($line, 4, 3);
$value = utf8_substr($line, 11, 6);
$value = ( $value / 102.9 * 100 );
Tried that, still no change in the admin section or on the store front.pprmkr wrote:When in System - Settings - Store: Local -> Auto Update Currency: is set to Yes, just click on Dashboard to update the currencies.
Also tried switching the Auto Update Currency Off -> save then switch it back On, no change.
I can wait till tomorrow to see if it changes the rates then - just keen to see live changes
It only updates once a day. You can force update the currency by editing /admin/controller/common/home.php and changing:
to:
Code: Select all
$this->model_localisation_currency->updateCurrencies();
Code: Select all
$this->model_localisation_currency->updateCurrencies(true);
-Ryan
Great that got the currency to update, but the formula was the wrong way round:
This would equate to current exchange rate1.1667 less 2.9% = 1.1338, so before the calculation of a product costing £100, would have been 116.67 Euros, and after the calculation would be 113.38 Euros.
So the code should be:
This would equate to current exchange rate1.1667 pluss 2.9% = 1.2005, so before the calculation of a product costing £100, would have been 116.67 Euros, and after the calculation would be 120.05 Euros.
So now when PayPal deduct 2.9% for their exchange of the Euros back into GBP we get £100.11
Thanks to everyone for the help on this, and i hope it helps others
Code: Select all
foreach ($lines as $line) {
$currency = utf8_substr($line, 4, 3);
$value = utf8_substr($line, 11, 6);
$value = ( $value / 102.9 * 100 );
So the code should be:
Code: Select all
foreach ($lines as $line) {
$currency = utf8_substr($line, 4, 3);
$value = utf8_substr($line, 11, 6);
$value = ( $value * 102.9 / 100 );
So now when PayPal deduct 2.9% for their exchange of the Euros back into GBP we get £100.11
Thanks to everyone for the help on this, and i hope it helps others
Hi, we use Opencart 2.1.0.2 and we have same problem the price in EUR should be higher then now, i tried same code in currency.php but it is not change anything at all. Could you help me with this please.
PayPal's exchange rates are different to the official exchange rates. They designed to make money for PayPal when used to convert currencies.
The best method is to add the other currencies to your PayPal and your store, so that you can accept payment in the other currencies. That way, any loss (or profit) from exchanging currencies is borne by you and not your customer.
The best method is to add the other currencies to your PayPal and your store, so that you can accept payment in the other currencies. That way, any loss (or profit) from exchanging currencies is borne by you and not your customer.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Can you advise me please what code i can use for Opencart 2.1.0.2? I tried to do what you said but it is not work.James_K wrote:Great that got the currency to update, but the formula was the wrong way round:This would equate to current exchange rate1.1667 less 2.9% = 1.1338, so before the calculation of a product costing £100, would have been 116.67 Euros, and after the calculation would be 113.38 Euros.Code: Select all
foreach ($lines as $line) { $currency = utf8_substr($line, 4, 3); $value = utf8_substr($line, 11, 6); $value = ( $value / 102.9 * 100 );
So the code should be:This would equate to current exchange rate1.1667 pluss 2.9% = 1.2005, so before the calculation of a product costing £100, would have been 116.67 Euros, and after the calculation would be 120.05 Euros.Code: Select all
foreach ($lines as $line) { $currency = utf8_substr($line, 4, 3); $value = utf8_substr($line, 11, 6); $value = ( $value * 102.9 / 100 );
So now when PayPal deduct 2.9% for their exchange of the Euros back into GBP we get £100.11
Thanks to everyone for the help on this, and i hope it helps others
Who is online
Users browsing this forum: No registered users and 37 guests