Auto currency exchange rate

More
9 years 2 weeks ago #5343 by idizajn
Auto currency exchange rate was created by idizajn
Hello,

It would be great that currencies are auto updated instead manually entering exchange rate...
So user have option to check from list which currency is default as now, and instead creating new currencie he just check ones he want from list and they are showed on site and auto calculated if user choose some different than default on frontend.
Also , since it has to find exchange rate online, then convert it on site, it would be little slower process than manually entering so You should optimize it for top speed. Maybe if possible check currency once in 24hrs or 12hrs and write that value on site?

I am really wondering why it is not included already but ok.

And will ti be included in 0.9 ?

Thanks a lot

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

More
9 years 2 weeks ago #5353 by idizajn
Replied by idizajn on topic Auto currency exchange rate
Answer would be appreciated, thanks..

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

More
9 years 2 weeks ago #5356 by vietvh
Replied by vietvh on topic Auto currency exchange rate
Hi idizajn,

We've been waited to see how other users think about this feature therefore we haven't replied to you yet.

We are already working for v0.9.0, the main features for it is back end reservation creation and Feedback plugin. Other features will have lower priority therefore we can not say for sure. In addition, a feature request need to get interest from other users as well.

Regards,
The following user(s) said Thank You: idizajn

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

More
8 years 8 months ago #6048 by hapa003
Replied by hapa003 on topic Auto currency exchange rate
Hi, I have made a simple script that retrieves rate from openexchangerates.org and updates the database.
You can edit the index.php and add include_once "thescript.php"; .

//*************decode JSON****************
$json_string = 'openexchangerates.org/api/latest.json?app_id=NNNNN';
$jsondata = file_get_contents($json_string);
$data = json_decode($jsondata, false);

//************connect and update database************
mysql_connect("domain", "user","pwd");
mysql_select_db("schema");

//USD always 1
mysql_query("UPDATE sr_currencies SET exchange_rate = 1 WHERE currency_code = 'USD'") or die("Update Failed!");

//Repet the line below for all your currency only change EUR to your currenscy code
$rate=$data->rates->EUR; mysql_query("UPDATE sr_currencies SET exchange_rate = '$rate' WHERE currency_code = 'EUR'") or die("Update Failed!");

//tabel sr_currencies can have an extension like abcde_ before the tablename

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

More
8 years 8 months ago #6053 by vietvh
Replied by vietvh on topic Auto currency exchange rate
Hi hapa003,

Thank you for sharing your code.

Regards,

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

Moderators: solidres
Powered by Kunena Forum

All the things you need to make your work easier. Did you like Solidres?