Jump to content

[Admin] Automated currency updates


Guest

Recommended Posts

File Name :: Automated currency updates

Author :: webwonderuk

Category :: Admin

Description

Automatically update the currencies on the website with the click of a mouse.

This script is set up for stores using UK Pounds as the default currency and will update the default currencies (Except Mexican peso) direct from the European Central Banks currency feed.

Updatable manually from admin or a cron job script is included for fully automated updates from the server.

View File

Link to comment
Share on other sites

I have just finished modifying this script for any currency to automatically update.

Will be posted and available for download once approved by admin.

Link to comment
Share on other sites

  • 3 weeks later...
Guest hobbyofkings

This is brilliant, I love it... BUT it doesn't work on my GBP? I have default currency Australian. All the others work, GBP reports success but the change doesn't actually happen. Any thoughts? Any one have this problem. Have had it a few times over (multiple reinstalls learning Cube Cart)...

Link to comment
Share on other sites

Thanks hobbyofkings i think you have found a small error in the script.

Open up convert.php.

Approx line 131 it reads

$sql = mysql_query("update ".$glob['dbprefix']."CubeCart_currencies set value='$exchanged',lastUpdated=$timer where name='US Dollars'");




Change to:


$sql = mysql_query("update ".$glob['dbprefix']."CubeCart_currencies set value='$exchanged',lastUpdated=$timer where name='British Pounds'");

That should sort the problem out.

Link to comment
Share on other sites

Installed the mod - it works great!

Just wonder how to add a new currency, namely Czech crown (CZK). I found that czk-CZK is on the bank list, copied the last conversion formula in the convert file with all the attributes and mechanically replaced the currency symbols, entered the currency name - and ... failed.

Could you, webwonderuk, tell me the corrent procedure? Thanks a lot...

Link to comment
Share on other sites

Hi Gaijin,

Have attathced a file with the czech update, it is important that on the database the czech currency code is CZK and the currency name is exactly Czech Koruna

Just use this convert.php file and everything should be ok, although i havent tested it!!!

convert.php

Link to comment
Share on other sites

Thanks webwonderuk a lot,

I'm going to try it out B)

The problem may has been caused by my excessive creativity as I put the Koruna in plural Korunas :innocent:

Link to comment
Share on other sites

Hi MAssIVE,

First be sure the prices in your DB are in EUR. Then, being logged as Admin, select "Currencies", edit EUR so its value turns "1". The exchange ratios of the other currencies will be recalculated accordingly. The default currency in the General Settings is merely for displaying, not for calculation. This separation has been another "nasty" ;) CC trick and the reason I choose this script.

Link to comment
Share on other sites

I was thinking the same....I also have a question tho....for neone who knows:

Q: How can i modify this to have default US dollars...and does this work for 3.0.4?

Link to comment
Share on other sites

Guest benlogan

Hi MAssIVE,

First be sure the prices in your DB are in EUR. Then, being logged as Admin, select "Currencies", edit EUR so its value turns "1". The exchange ratios of the other currencies will be recalculated accordingly. The default currency in the General Settings is merely for displaying, not for calculation. This separation has been another "nasty" cool.gif CC trick and the reason I choose this script.

to set a default currency, it must be sent to 1

also,make sure you dont have multiple of them.

and yes it will work for 3.02, 3.03 and 3.04. i dont know about previous versions beccause i started at 3.02.

Link to comment
Share on other sites

Q: why use the currency text name in the sql, rather than the universally accepted 3 char code?

Hi fiddy,

I think these are just plain text, not variables. By editing admin/settings/convert.php you can enter any text you want to. The actual values for rate calculations are being input on daily basis from here:

http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml

Link to comment
Share on other sites

Q: How can i modify this to have default US dollars...and does this work for 3.0.4?

Hi AmeFa,

Do as benlogan told: Edit USD from the Admin panel/Currency and overwrite the current value to get 1. The toucan hidden in CC will do the rest. :D

Link to comment
Share on other sites

  • 2 weeks later...
Guest limkimpoh

Hello, i got a slight problem here, my default currency is in singapore dollars and its being set to value 1 but i got the following warning as below. Any advice ?

Thanks.

Warning: Division by zero in admin/settings/convert.php on line 112

:whistle:

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
Guest digilution

The latest version that works in v3.06 is available in my mod store, i am rebuilding shortly to accept all currencies worldwide supported by the ECB.

The mod is gr8 but now I want to use the cronjob version. What should I put in the ' command to run' setting up the cron.

If I can get this sorted and give the customer the option of what currency to choose, what happens on checkout....will it be done in their currency or will it be in GBP?

Cheers

Link to comment
Share on other sites

×
×
  • Create New...