Forums / All Other Contributions/Addons / Currency Update (Automatic)

Currency Update (Automatic)

Views: 82,431

Results 161 to 180 of 298
25 Aug 2009, 3:44 PM
#161
charals avatar

charals

New Zenner

Join Date:
Jun 2009
Posts:
28
Plugin Contributions:
0

Currency Update (Automatic)

I am using the download automated_currency_update_v3_1.

So far I have had no error messages. But am waiting for the currencies to change. I will give it a few days to see how it goes.

I will check with my hosting service if there are any successful confirmation emails with their CRON feature. I would rather not have any as to not fill up me email inbox.

I appreciate your help very much.

Charals

26 Aug 2009, 12:12 PM
#162
zahid avatar

zahid

New Zenner

Join Date:
Aug 2009
Posts:
30
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi All!

I want to set currency updation for my client, now i put my currency_update.php in directory. /var/www/dev01/shzaikhn/surarean/internationalgalleryexposure.com/cartfm/pub
and i give path like this.
DEFINE('PATH_TO_STORE_ROOT','pub/currency_update.php');
now my qustion is that, how i will call corn, how mail i will recieve , i dont know if these are working or not, if error are remove.
i just calling that currency_update.php file like.
and please told me, what is the process of its working, means how calling are done.

team-kh.awpdc.com/~shzaikhn/surarean/internationalgalleryexposure.com/cartfm/pub/currency_update.php

but it give me error like,

Warning: require_once(includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/dev01/shzaikhn/surarean/internationalgalleryexposure.com/cartfm/pub/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required 'includes/configure.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/dev01/shzaikhn/surarean/internationalgalleryexposure.com/cartfm/pub/currency_update.php on line 20

please help me, i am very confused what i do for this.

Any help would be realy appreciate,:smartalec:

29 Aug 2009, 8:31 AM
#163
danielson avatar

danielson

New Zenner

Join Date:
Jan 2009
Posts:
16
Plugin Contributions:
0

Re: Currency Update (Automatic)

Can anyone point me towards an example of this module actually working on a live Zen Cart site? I went through 5 pages of this long thread but didn't see a real example.

Thanks :)

29 Aug 2009, 10:13 AM
#164
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Currency Update (Automatic)

I run it on any site operating with more than one currency, but there's nothing to see. It's all hidden away behind the scenes.

If your point is that the thread contains posts primarily with people having problems, well that's the nature of a support thread. People who install and run it without problem don't really have any reason to post here.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

29 Aug 2009, 2:33 PM
#165
danielson avatar

danielson

New Zenner

Join Date:
Jan 2009
Posts:
16
Plugin Contributions:
0

Re: Currency Update (Automatic)

Thanks kuroi

Is there an option to change currency? e.g. if price is displayed by default in £, can the user change it to $?

29 Aug 2009, 2:39 PM
#166
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Currency Update (Automatic)

This mod only updates currencies, it doesn't touch prices which are converted to the appropriate currency by Zen Cart core code.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

4 Sep 2009, 2:23 PM
#167
schtoo avatar

schtoo

New Zenner

Join Date:
Apr 2009
Location:
Japan.
Posts:
21
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi,

Got a question for those folks who might understand what's going on with the currency update addon I have that just stopped working...

The cronjob I had running the update automatically today returned a timeout error, and doing the same thing manually gets the same time out. I am using the EU site for updates.

The error I get is this...

Warning: file(http://www. e c b.europa.eu/stats/eurofxref/eurofxref-daily.xml) [function.file]: failed to open stream: Connection timed out in /home/mysite/public_html/currency_update.php on line 37

Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/currency_update.php on line 40

The .php file on the site has not changed (when compared to a known good file) , and it looks like the EU site is there and working and the mod has been working just fine for the past few months.

Any ideas why it's stopped working just now?

(And I just ran it again now, it's working again! I guess this means it's something that generally isn't noticed? Something not to worry about?)

Thanks, and I hope some good comes of this, even if what I had happening was nothing... :unsure:

24 Oct 2009, 7:51 PM
#168
wurdup avatar

wurdup

New Zenner

Join Date:
Oct 2009
Posts:
28
Plugin Contributions:
0

Re: Currency Update (Automatic)

to anyone having problems with the root directory install I had problems with this until I removed the . at the start of the directory address.

$location = '/home/[username]/public_html/'; // location of zen-cart intall

seemed to work fine after that.

24 Oct 2009, 10:57 PM
#169
wurdup avatar

wurdup

New Zenner

Join Date:
Oct 2009
Posts:
28
Plugin Contributions:
0

Re: Currency Update (Automatic)

Ok I'll post my setup to help people having problems. (Using justhost.com)

using standard cron through cpanel:

php -q /home/[username]/public_html/catalog/currency_update.php

php -q tells the cron to use the php intrepter or the cron will just try to run each line in the php file itself.

the php file has:

$location = '/home/[username]/public_html/catalog/'; // location of zen-cart intall

Although yours may not have the catalog folder. Make sure you include the '/' at the end and in this case I had to delete the '.' at the start.

The file persmission needs to be 644 although some cron jobs need 755? i think.

With this currency_update.php script I added an email function that tells you when the script has been run. I had concerns that a user can run the script to update currencies when rates suddenly drop in a certain currency and therefore purchasing the product for cheaper than you intended. Ok it's unlikely but never say never.
Anyway this addition emails you when its run and also the new rates. This also provides you with a backup of currency rates if you need to change them back.

add this:

 require_once($location.'includes/configure.php');
 require_once($location.'includes/database_tables.php');
 // no need to edit below this line
 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


$newrates=''; // add this here

now add the $newrates code to the orignal and also the email function so it looks like:

    $newrates = $newrates."\n".$currency['code']." ".$rate;
	
    if ($rate) {mysql_db_query(DB_DATABASE, "update " . TABLE_CURRENCIES . " set value = '" . $rate . "', last_updated = now() where currencies_id = '" . $currency['currencies_id']. "'", $link);}
   }
 }

 mysql_close($link);
 //end lookup

$to = "[email protected]";
$subject = "Currency Update";
$thedate = getdate();
$thedate = $thedate['hours'].":".$thedate['minutes'].".".$thedate['seconds']." ".$thedate['mday']."/".$thedate['mon']."/".$thedate['year'];
$body = "mywebsite.com\n\ncurrency_update.php script has been run on ".$thedate."\nRate: ".$newrates;
if (mail($to, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
}

dont forget to change the email address.

Not sure if that will help you or not but it's helped me.

29 Nov 2009, 10:40 AM
#170
pazaz avatar

pazaz

New Zenner

Join Date:
May 2007
Posts:
47
Plugin Contributions:
0

Re: Currency Update (Automatic)

I have tried both versions and get similar results, the latest "currency_update_curled.php: Permission denied"
I have asked my host if they can fix it and basically they say no. Only if I set up my own php.ini and I really dont have the guts for all that.

QUOTE The issue here is that, for security reasons, we have remote url access through fuctions like file disabled. UNQUOTE

Are there any other options (apart from moving host) ???

rgds
Mick

15 Dec 2009, 6:17 PM
#171
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi!

Is it possible to tell the script to fetch currencies the same way as the manual ZenCart update? (At least as backup)
As for now one of the currencies (isk) is coming out with 0,- and thats really bad business... :unsure:

25 Jan 2010, 11:13 PM
#172
lockerroom avatar

lockerroom

New Zenner

Join Date:
Sep 2009
Posts:
35
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi guys,

I keep on getting this message when it tries to do it's task

No input file specified.

26 Jan 2010, 10:00 AM
#173
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

Halloj.

Found that "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" are missing the value for isk. However, manual currency update from "xe" provide it.
-How should I change "Define currency file" to fetch from "xe" instead of "ecb"?
Or maby even better as an backup, same way manual curency update does?

Troll

29 Jan 2010, 9:17 AM
#174
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi.

Since "ecb" doesent provide one of the currencies I'm interested in, (one of the worlds most instable that is) I assume it should'nt be to complicated to fetch currenciy from "oanda" and/or "xe" (or somewhere else) instead?

At least tell the update function NOT to set values to zero!

Could someone please be so kind and give a hint!?

Troll

29 Jan 2010, 10:22 AM
#175
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Currency Update (Automatic)

Troll:

Hi.

Since "ecb" doesent provide one of the currencies I'm interested in, (one of the worlds most instable that is) I assume it should'nt be to complicated to fetch currenciy from "oanda" and/or "xe" (or somewhere else) instead?

At least tell the update function NOT to set values to zero!

Could someone please be so kind and give a hint!?

TrollEarlier versions of this mod used oanda and xe. However, they changed they terms of use to outlaw screen scrapping. So the mod was changed to the ECB feed to keep it legal.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

29 Jan 2010, 12:36 PM
#176
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

kuroi:

Earlier versions of this mod used oanda and xe. However, they changed they terms of use to outlaw screen scrapping. So the mod was changed to the ECB feed to keep it legal.

Thanks for answering kuroi!

Yes I have read something about that legal pov. But the built in update (localization.php as I understand) uses oanda / xe, and seem to work just fine... What's the difference? I reckon admin tools has to be as legal as some add-on!?...
-Zen Cart v.1.3.8 btw.

Just havent got the knowledge to combine the two scripts, as it seem to be the most obvious solution?...

As I said, isk in particular should be updated often! Actually with that currency this is a do or don't question...

Also seem to be a glitch that the "old" currency doesen't sustain when not fed with new values!?...

29 Jan 2010, 1:39 PM
#177
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Currency Update (Automatic)

The difference is that the admin script was written in 2006, before the terms of use were changed. Earlier versions of the mod were based on that code. Though of course, I couldn't possibly suggest that you try using them instead.

I'm afraid that I don't understand your last paragraph.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

29 Jan 2010, 2:31 PM
#178
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

Ok. thank's. Sorry to be slow... :wacko:

Still don't understand the legal thingy though... -No one could be blamed for using old verions, I get that. But I don't understand that including an old script to a new version makes it legal?...
But then again, I don't catch much of all them laws anyway... :cool:

Now I have this other problem:
I can't upgrade the addon because of superstition and a bad knee..
Could you please guide me how to fix the convertion ratio issue?

Also tried to explain with rough English:
If the supplier -feeder- of currencies give no value for a certain currency, (today this is the case with ECB and ISK found here) then the currency should stay with the latest updated value, instead of update to a value of zero! Otherwhise all products are marked zero-price for that currency!

Thank's a lot!
Troll

29 Jan 2010, 3:55 PM
#179
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

Troll:

Now I have this other problem:
I can't upgrade the addon because of superstition and a bad knee..
Could you please guide me how to fix the convertion ratio issue?
Acutally this seem to be working just fine!:smile:

30 Jan 2010, 4:57 PM
#180
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Currency Update (Automatic)

FINALLY I got this up and running! :smile:
I have spent so many hours on this supposedly simple task!... So I thought I should post some SOLUTIONS to some of the issues I have struggled with. As always, answers are more or less obvious, and have been enlightened before…
With a possibility to be totally out sailing, this works for me (so far):

currency_update.php

The versions after 2006 are using “ecb” for feed. Earlier versions are using “oanda” and ”xe” as the manual update in your Admin.

The mod, consisting of a single file, could be placed anywhere, but has to be edited to work:
In the first line of script (about row 14-17) “DEFINE” You should set the path FROM the file to the root of your store.
E.g. If you put the file directly onto your store root, this should only be a slash “/”. If you put it in “includes” it should be “./” and so on. (Path upwards in hierarchy)

In the next two lines “require_once” I had to set the FULL path to the two files: “configure.php” and “database_tables.php”. On my server I have named my store root “shop”, and my path is roughly: “/home/t/troll/www/shop/includes/configure.php” and “/home/t/troll/www/shop/includes/database_tables.php”

Cron job

In your command shell write “crontab –l” to list your crontab, and “crontab –e” to edit it. To edit in “VI” use “i” to insert, and “Esc : w q” to write to file and quit VI.

Your crontab has to include the full path to your “currency_update.php” file.
In my case I also had to include full path to php command. My cron that runs for every 6’th hour look like this:
** 0-23/6 * * * /usr/local/bin/php /home/t/troll/www/shop/currency_update.php*
(Beware of the space between the php command and the path to the currency_update.php file.)

The cron setup paremeters are:

.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |

          • command to be executed

For example, to run a cron job once a day at midnight set up:* 0 0 * * * /path/to/php /path/to/file.php*

To test your cron job you could set the job for a short interval. E.g. Setting it: 0-59/2 * * * * /path….
Will run the job every second minute. It’s then easy to check if your currency rate changing just by changing the “Currency Conversion Ratio” in your “Admin > Configuration > My Store”, and wait for two minutes. (Assuming that one works as it should…)

If you set the parameters wrong in your crontab, it should output a message when you save.
If you for example have got the paths wrong, and the job is NOT working properly, it outputs a mail with the error. (Just write “mail” in your command shell.)

Btw. You can check what services your host provides by simply making an “info.php” file, and add the code: <? phpinfo(); ?> into it. Then just open the “info.php” file in your browser.)

Hope this could be of some help for somebody! :P

Troll :cool: