VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: titolin10 on February 11, 2018, 18:10:14 PM

Title: Currency exchange rate is wrong
Post by: titolin10 on February 11, 2018, 18:10:14 PM
Hello

My shop is supporting different countries with different currencies as well

but I really don't know why when I change the currency using selector module to another one then the Value appear wrong

For example if 1 USD =  3.95 MYR  then when I change the USD currency on frontend using selector module  I found the MYR = 1.13   (That's just an example)


It's really big problem because if I have a product that equal USD 100  then the customer used MYR currency then he will pay only  MYR 113 ... So in this case I lost MYR 282  and that equal 71 USD.... SO I look like I'm going to lose not earn  ;D :'( :'( :'(

How to solve this ??


Title: Re: Currency exchange rate is wrong
Post by: Jörgen on February 11, 2018, 20:47:31 PM
http://forum.virtuemart.net/index.php?topic=79799.0 (http://forum.virtuemart.net/index.php?topic=79799.0)

When did it stop working ?
What Did You Do that stopped the correct exchange ?

regards

Jörgen @ Kreativ Fotografi
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 12, 2018, 02:12:57 AM
Hello Jörgen


Thank you for your response


I use VM 3.4.12 + Joomla 3.8.5


I didn't do anything .. since I used Virtuemart few months ago I seen this problem but that time I was only using one currency


since I decided to support more currencies then I faced this issue again

I don't know how to solve it


as mentioned above the converter is giving me wrong prices with wrong rates
Title: Re: Currency exchange rate is wrong
Post by: Jörgen on February 12, 2018, 06:53:55 AM
OK so you are NOT loosing any any sales because You haven´t published this yet.

I would check the settings for the shop and make sure correct currency is set there. also check Your Product and see what currency You see there.

Maybe this can help ?
http://forum.virtuemart.net/index.php?topic=139262.msg489098#msg489098 (http://forum.virtuemart.net/index.php?topic=139262.msg489098#msg489098)

regards

Jörgen @ Kreativ Fotografi
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 12, 2018, 16:16:42 PM
Thank you Jörgen

The cost price, base price and the final price are in the same currency

Vendor currency is same too and I'm using PHP 7.0  ;D


I don't know is this rate should change automatically using built-in converter or I should set it by myself?
Title: Re: Currency exchange rate is wrong
Post by: jenkinhill on February 12, 2018, 17:35:28 PM
The exchange rate is at the European Central Bank is checked daily to give the current rate. The Euro is used as the base currency, the file is downloaded to the Joomla cache as daily.xml
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 12, 2018, 19:46:02 PM
Thank you jenkinhill

The rates are completely wrong and I tested it with many currencies without any result

another example:

If 1 MYR = 4.49 EGP

So if I have product equal 99 MYR then it should be 444.43 by EGP (According to google converter)

but I got wrong result like that

99 MYR = 20.37 EGP



I tested many currencies and always the main currency for shop become the lower value


Any solution ?

Title: Re: Currency exchange rate is wrong
Post by: Jörgen on February 13, 2018, 06:55:32 AM
Show settings for currency and Product price.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 13, 2018, 16:07:49 PM
Thank you Jörgen


herewith the settings attached
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 13, 2018, 16:08:53 PM
see attached here also
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 13, 2018, 16:09:21 PM
last
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 15, 2018, 19:40:02 PM
Hello

any solution please ?
Title: Re: Currency exchange rate is wrong
Post by: titolin10 on February 20, 2018, 12:26:15 PM
up
Title: Re: Currency exchange rate is wrong
Post by: Jörgen on February 20, 2018, 12:52:58 PM
I have a guess. The EGP is not on the ECB list of currencies. Here comes yesterdays list. I Think You have to add You own conversion for EGP against the base currency of Your shop. See image, EURO as base currency.

<?xml version="1.0" encoding="UTF-8"?>
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
<gesmes:subject>Reference rates</gesmes:subject>
<gesmes:Sender>
<gesmes:name>European Central Bank</gesmes:name>
</gesmes:Sender>
<Cube>
<Cube time='2018-02-19'>
<Cube currency='USD' rate='1.2410'/>
<Cube currency='JPY' rate='132.24'/>
<Cube currency='BGN' rate='1.9558'/>
<Cube currency='CZK' rate='25.327'/>
<Cube currency='DKK' rate='7.4480'/>
<Cube currency='GBP' rate='0.88590'/>
<Cube currency='HUF' rate='311.15'/>
<Cube currency='PLN' rate='4.1460'/>
<Cube currency='RON' rate='4.6613'/>
<Cube currency='SEK' rate='9.9155'/>
<Cube currency='CHF' rate='1.1513'/>
<Cube currency='ISK' rate='124.70'/>
<Cube currency='NOK' rate='9.6575'/>
<Cube currency='HRK' rate='7.4385'/>
<Cube currency='RUB' rate='70.0709'/>
<Cube currency='TRY' rate='4.6575'/>
<Cube currency='AUD' rate='1.5676'/>
<Cube currency='BRL' rate='4.0126'/>
<Cube currency='CAD' rate='1.5592'/>
<Cube currency='CNY' rate='7.8734'/>
<Cube currency='HKD' rate='9.7075'/>
<Cube currency='IDR' rate='16818.58'/>
<Cube currency='ILS' rate='4.3673'/>
<Cube currency='INR' rate='79.7375'/>
<Cube currency='KRW' rate='1323.97'/>
<Cube currency='MXN' rate='23.0128'/>
<Cube currency='MYR' rate='4.8281'/>
<Cube currency='NZD' rate='1.6820'/>
<Cube currency='PHP' rate='65.100'/>
<Cube currency='SGD' rate='1.6295'/>
<Cube currency='THB' rate='38.943'/>
<Cube currency='ZAR' rate='14.4614'/>
</Cube>
</Cube>
</gesmes:Envelope>


regards

Jörgen  @ Kreativ Fotografi
Title: Re: Currency exchange rate is wrong
Post by: jjk on February 24, 2018, 22:50:53 PM
Quote from: titolin10 on February 12, 2018, 19:46:02 PM
The rates are completely wrong and I tested it with many currencies without any result
another example:
If 1 MYR = 4.49 EGP
So if I have product equal 99 MYR then it should be 444.43 by EGP (According to google converter)
but I got wrong result like that
99 MYR = 20.37 EGP

That looks like a mix of 'direct quotation' and 'indirect quotation'.
Exchange rates between two currencies can be quoted indirectly or directly. Direct quotation states how much one unit of foreign currency costs  in domestic currency units (eg $1 = €0.73), whereas indirect quotation states how many units of foreign currency you would receive for one unit of domestic currency (eg €1 = $1.37). In foreign exchange trading, the international convention is to quote the euro against all other currencies using the indirect quotation method.
Title: Re: Currency exchange rate is wrong
Post by: Jörgen on February 24, 2018, 23:32:16 PM
What is this for an answer ?  Please tell how to solve it, EGP is not on the list, therefore You get a weird exchange rate. Do not know how VM it gets the rate, because there is none in the look up table from ECB. My proposed solution seems to work, is that the correct way to do it or not ?

There are only 32 currencies on the list, so this ECB lookup is not a universal solution. You need to add Your own exchange rates.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Currency exchange rate is wrong
Post by: jjk on February 25, 2018, 20:10:05 PM
QuoteWhat is this for an answer ?
Was just meant to explain the numbers VM displays. ;)

The currency exchange rates pulled from the ECB (European Centreal Bank) are using EUR as the base currency. So their data includes for example
1€=1324.37 KRW
1€=4.8135 MYR

When a different currency is used as the shop (base) currency, then you might have to reverse the exchange rate calculation.
Example 1: In the case of 63 MYR (without discount applied) you will need to enter 0.20775 (1 divided by 4.8135) as the EUR exchange rate into the EUR 'Currency Details' if you want to display the price in EUR.
Example 2: If the currency is not listed in the ECB, you would get a division by 1, resulting into an EUR value followed by the unlisted currency symbol.
Example 3: The ECB does not provide cross rates and therefore VM doesn't calculate for example EGP from a MYR price entered into VM. So to convert 1 MYR (in VM) into EGP you will have to enter the a value of 4.52317 (yesterdays exchange rate from oanda.com) as the EGP exchange rate into the EGP 'Currency Details'. This currently displays a (rounded) price of EGP 285 (MYR 63).

Note that the calculation might also be affected by other configuration settings like rounding and other calculation rules which can lead to different wrong results. So check the results carefully if you want to offer payment in different currencies.