debugginglife Posted October 25, 2008 Share Posted October 25, 2008 Hi,I am new at prestashop. I realized that real time currency exchange feature is not uptodate. The data comes from the http://www.prestashop.com/xml/currencies.xml, which is an old file.After some investigation i found the site of European Central Bank http://www.ecb.europa.eu/home/html/index.en.htmlThe ECB gives the currency exchange rates in XML format at http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml. The exchange rates of ECB are updated daily and more important thing is "They are from a very trusted and reliable source"I modifed the currency.php file located at prestashop_1.0\classes folder. When you replace the currency.php file with my modified file, you will get the exchange rates of ECB. I wish it will help your business.Note: Check the ISO symbol of the currencies from http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html Currency.zip Link to comment Share on other sites More sharing options...
TropischBruin Posted October 26, 2008 Share Posted October 26, 2008 Great job!Thanks for making PS and our life much less complicated! :cheese: Link to comment Share on other sites More sharing options...
cecepee Posted October 31, 2008 Share Posted October 31, 2008 Thanks.Can you just confirm if that is the solution to my currency problem in this thread?http://www.prestashop.com/forums/viewthread/6643/installation_configuration___upgrade/not_correct_update_on_currency_whyYour help is most appreciated.Thanks, really.//Peter Link to comment Share on other sites More sharing options...
Ratatosk Posted October 31, 2008 Share Posted October 31, 2008 Thank you Debugginglife for this modified file, it seems to work.One question : does this modification automatically update the currencies rates ? Or must I update them daily manually, by clicking on Update currencies in the BO ?And I'm surprised, after hanving replaced my currency.php vith your modified version, after updating :1€ = 1.3035$ = 0.7907£ But when looking at http://fr.finance.yahoo.com/convertisseur?u 1€ = 1,276$ = 0,78847£What's wrong ?Thank you ! Link to comment Share on other sites More sharing options...
Ratatosk Posted October 31, 2008 Share Posted October 31, 2008 After reading http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.htmlandhttp://fr.finance.yahoo.com/convertisseur?uit seems that Yahoo change rates are "realtime" updated, and the Euro foreign exchange reference rates of ECB are the values for the previous day at 2:15 PM.Anyway, thanks a lot for your work, it's usefull.R. Link to comment Share on other sites More sharing options...
Paul C Posted October 31, 2008 Share Posted October 31, 2008 You may find this article useful. This isn't a trivial issue, especially in times when currencies are particularly volatile!http://www.currencysystem.com/kb/3-143.htmlPaul Link to comment Share on other sites More sharing options...
debugginglife Posted October 31, 2008 Author Share Posted October 31, 2008 Hi,Regarding the question of Ratatosk One question : does this modification automatically update the currencies rates ? Or must I update them daily manually, by clicking on Update currencies in the BO ? Yes, you have to press Update Currencies button to update currencies. ECB gives the currencies daily so there can be some differences with other sources. ECB gives the currency rates previous business day. If there are some other reliable currency rate sources in xml format, i can try to supply those rates also Link to comment Share on other sites More sharing options...
tongfaafaasai Posted December 21, 2008 Share Posted December 21, 2008 Hi debugginglife,i downloaded the new version 1.1 and it seems prestashop still have an old currency XML included. i have changed the link to http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml and the currency still not updated correctly.since you are experience with this can you please be kind have a look at the new 1.1 version. thanksthanks Link to comment Share on other sites More sharing options...
debugginglife Posted December 21, 2008 Author Share Posted December 21, 2008 Hi,I have been still using the previous version in my shop, thus i have not had a test environment for the changes. Therefore, someone expert on php might deal with the changing currency rate source. It will cost me so much time. Link to comment Share on other sites More sharing options...
strs156 Posted December 21, 2008 Share Posted December 21, 2008 Hello I am new here .I am testing prestashop about 1 week now .I like it But...The currency issue (outdated) remains in the new final version 1.1Your fix debugginglife was very nice but its not working with new versionI modified the new currency.php based on your fixed and its working now for me in ver1.1Here is the file: Currency_v1.1.zip Link to comment Share on other sites More sharing options...
tongfaafaasai Posted December 21, 2008 Share Posted December 21, 2008 hi strs156,excellent, it works for me now. however, there is 1 small issue related to it that is when you change the default currency and click SAVE the value of the new default and old default will be the same i.e. 1. To adjust that value, i need to click "update currencies rates" button and things will work fine.it would be nice though if by changing the default currency the rates change as well. Link to comment Share on other sites More sharing options...
debugginglife Posted December 21, 2008 Author Share Posted December 21, 2008 thanks, strs156 for your kind contribution. Link to comment Share on other sites More sharing options...
strs156 Posted December 21, 2008 Share Posted December 21, 2008 hi strs156,excellent, it works for me now. however, there is 1 small issue related to it that is when you change the default currency and click SAVE the value of the new default and old default will be the same i.e. 1. To adjust that value, i need to click "update currencies rates" button and things will work fine.it would be nice though if by changing the default currency the rates change as well. glad to be helpful ..I am not a coder and my knowledge in scripting are very limited .I wish it could be automated or better yet we had a module that configures all that and updating automatic Link to comment Share on other sites More sharing options...
cecepee Posted January 7, 2009 Share Posted January 7, 2009 Anyone else that didn't get this to work??In 1.0 i replaced my file with the one from debugginglife and it worked fine.In ver 1.1 it is not longer working. So i uploaded strs156 version of the currency.php but that file gives me "parse error"What to do?Anyone who can help out?This is i think an important module, specially with today's economy.Best regardsPeter Link to comment Share on other sites More sharing options...
dlwebco Posted February 3, 2009 Share Posted February 3, 2009 AHHHH! Can anyone help me please?I have version Version 1.1.0.5 - 0.117s and I have updated Currency.php as in the zip file above and when I click "update currency" once I have uploaded the file I get the following error "Hack attempt (Currency -> sign = €)"I want to disable Euros & Dollars but again im getting the 'Hack attempt' errorPlease HELP!!!!ThanksDarshan Patel Link to comment Share on other sites More sharing options...
cecepee Posted February 3, 2009 Share Posted February 3, 2009 HelloI had same error with hack attempt.I actually just took away the euro sign and replaced with the letters EU, worked like a treat.//Peter Link to comment Share on other sites More sharing options...
Tommy H Posted February 9, 2009 Share Posted February 9, 2009 very nice contribution.. works like a charm! Link to comment Share on other sites More sharing options...
Bryan Lee Posted April 15, 2009 Share Posted April 15, 2009 Hello I am new here .I am testing prestashop about 1 week now .I like it But...The currency issue (outdated) remains in the new final version 1.1Your fix debugginglife was very nice but its not working with new versionI modified the new currency.php based on your fixed and its working now for me in ver1.1Here is the file: @ debugginglife, @ strs156: Hi all, i add a new currency in my website and setup it default: Dong (Vietnamese). I download your files and I can't update currencies rates, bcs The ECB gives the currency exchange rates in XML format at http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml but no have VND (Vietnamese Dong). I know the http://forexrate.com.au/ support converter all currencies, but i don't know how to config and modify the currency.php for my case. Please help me out. Thanks and best regards, Link to comment Share on other sites More sharing options...
ruilong Posted April 16, 2009 Share Posted April 16, 2009 Hi all, our company developed a similar feature, it's in module form so no need to hack into the core files. It also has cron job support, so no need to click the button everyday if you have a server that supports cron job.http://www.prestaworks.com/various/16-currency-update.html Link to comment Share on other sites More sharing options...
Bryan Lee Posted April 18, 2009 Share Posted April 18, 2009 No body here? Pls help me out.To ruilong: it not have VND. hic hic. Link to comment Share on other sites More sharing options...
ruilong Posted April 18, 2009 Share Posted April 18, 2009 Do you know of another feed with currency rates that support more currencies? if so, we can probobly make another module for that feed in a day or two. Link to comment Share on other sites More sharing options...
Bryan Lee Posted April 18, 2009 Share Posted April 18, 2009 Do you know of another feed with currency rates that support more currencies? if so, we can probobly make another module for that feed in a day or two. I'm sorry, I don't know. Could you help me and share for every body around here and me? Tks Link to comment Share on other sites More sharing options...
burpitt Posted May 18, 2010 Share Posted May 18, 2010 just spotted this so apologies if i'm rehashing old ground - but this mod is based on a Euro base rate, so updates all currencies AGAINST the euro.. SOOOO this is basically only for users who use EURO as a default currency.. unless you point it to reference an XML thats outputting with your own countries currency as the base unit..I'm just trying to think of ways you could sort of "fool" the backoffice around it.. but i've been coding most of the day and concentration is lacking at this point in the evening haha Link to comment Share on other sites More sharing options...
Malk Posted December 9, 2011 Share Posted December 9, 2011 anyone know if this works on v1.4 ? Link to comment Share on other sites More sharing options...
Mr.Moon Posted January 5, 2012 Share Posted January 5, 2012 UP! Link to comment Share on other sites More sharing options...
Jevgen Posted March 16, 2012 Share Posted March 16, 2012 for version 1.4.x watch this http://www.prestashop.com/forums/topic/90868-solved-european-central-bank-currency-update/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now