The built-in currency update button works with CURL, and the ECB option is now part of the v1.4.0 core with CURL support. Just one more good thing about the next version, due out soon :)
Printable View
It is worth noting that unlike the Oanda and XE, the ECB based only publishes reference rates for a select set of currencies. If a user has a currency outside that set, the code sets the rate to 0 which can cause users some grief.
It is necessary to escape updating any currency that returns a null value and perhaps sending the site admin an email to inform of this issue.
Agreed. And I certainly wouldn't recommend use of this mod for currencies not reported by the ECB. There's a link in the readme file bundled with the mod so that people can check what the currently reported currencies are.
That said, companies with access to the relevant foreign exchange information know that it is valuable and are generally trying to offer it at a price.
The ECB list was way ahead of the others that I could find that could be legitimately used in this way for this purpose. But if anybody knows of better, or even different, please do tell. Zen Cart's code is designed to support multiple provides of this information, so more sources could be added to fill in the gaps.
Kuroi
Thanks for the work done. I only posted this because I read DrBytes' post that the mod was being included in the upcoming release.
You are correct that the ECB seems to actually encourage web developers to use them legally and I can't think of any other legit source.
Perhaps you can edit the mod to escape null rates. Something like below.
Simply skipping such rates might be better than setting them to zero.Code:if ($rate != 0)
{
$updateSql = "UPDATE " . TABLE_CURRENCIES . "
SET value = '" . $rate . "',
last_updated = now()
WHERE currencies_id = '" . $currency['currencies_id']. "'";
mysql_db_query(DB_DATABASE, $updateSql, $link);
}
I have written a curled version of the 3.1 automatic currency update script.
Attachment 5131
What are the improvements of this new curled version v3.1 over the previous v2.0.1
Is it worth me replacing my current one?
Thanks. I found some info in the readme file also.
I copy pasted the script into my old one then changed location line 17 to my server root etc. ( i used the location from old script and place between the ' ' )
It seems to work Ok.
Thank you
Where can I adjust the spread?
(The difference between the actual rate and the one that is posted on the website?)
Thanks!