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

Currency Update (Automatic)

Views: 82,431

Results 121 to 140 of 298
2 Jun 2009, 1:37 PM
#121
shoesbuyonline avatar

shoesbuyonline

New Zenner

Join Date:
May 2009
Posts:
78
Plugin Contributions:
0

Currency Update (Automatic)

kuroi:

The answer can be found earlier in this thread. The built in service was written prior to the service providers changing their terms of business to forbid the screen-scrapping of real-time data that was common at the time. Nowadays you have to buy the service if you want to use it this way.

As a result the current version of the mod uses a different source (official European Central Bank rates, updated once a day). Zen Cart 2.0 will also use this legitimate source.

Thank you, Kuroi

Sorry, it's my careless.:blush:

3 Jun 2009, 3:06 PM
#122
noobuser avatar

noobuser

New Zenner

Join Date:
Feb 2009
Posts:
43
Plugin Contributions:
0

Re: Currency Update (Automatic)

hello,
when the script runs it keeps failing. I am with GoDaddy hosting service. Anybody here with similar issue?

much appreciate your help.

/home/content/s/i/t/username/html/currency_update/currency_update.php: line 1: ?php: No such file or directory
/home/content/s/i/t/username/html/currency_update/currency_update.php: line 2: /*: No such file or directory
/home/content/s/i/t/username/html/currency_update/currency_update.php: line 3: //Currency: No such file or directory
/home/content/s/i/t/username/html/currency_update/currency_update.php: line 4: //developed: No such file or directory
/home/content/s/i/t/username/html/currency_update/currency_update.php: line 5: //donations: No such file or directory
/home/content/s/i/t/username/html/currency_update/currency_update.php: line 6: //via: No such file or directory
/home/content/s/i/t/username/html/currency_update/currency_update.php: line 7: syntax error near unexpected token (' /home/content/s/i/t/*username*/html/currency_update/currency_update.php: line 7: //every little bit helps - why donate (http: //www.modyourzencart.com/free-of-charge/why-donate)'

7 Jun 2009, 4:41 AM
#123
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

nogal:

I have written a curled version of the 3.1 automatic currency update script.

Attachment #5131

Well done...this was the only one that worked for me....curl (required on servers running PhpSuExec) and EU central bank.

How often to run your cron? Well not that often..once a day is enough... ecb.int/stats/exchange/eurofxref/html/index.en.html states: The reference rates are based on the regular daily concertation procedure between central banks within and outside the European System of Central Banks, which normally takes place at 2.15 p.m. CET.

Why run it more often if the rates only update once a day!!!!!

Time your CRON......work out the time difference between your server and CET (GMT+1 or +2 when daylight saving in effect) go backwards or forwards (depends on where your server is) from 2.15pm (14:15) and that's the time to set your cron...actually I'd add on a bit more just in case the bank is slow. Weekends!!! well EU banks aren't open so rates probably wouldn't change so your cron can be run weekdays only not everyday......

best wishes all.............

7 Jun 2009, 8:55 AM
#124
kuroi avatar

kuroi

Totally Zenned

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

Re: Currency Update (Automatic)

noobuser:

hello,
when the script runs it keeps failing. I am with GoDaddy hosting service. Anybody here with similar issue?It looks to me as though the first character of your file, a "<", may be missing. But you're also using a very old version of the addon. Both the curled and non-curled versions currently in use have a header that looks like this:> <?php
/**

  • Automatic Currency Update v3.0
  • Originally by Richard Fink (masterblaster) based on Zen Cart manual currency update
  • updated by Kuroi to include Zen Cart's currency uplift ratio
  • further updated by Kuroi to use European Central Bank reference rates (adapted from ECB-supplied code)

I recommend going to the free software and addons section of this site and getting an up-to-date version.

Kuroi Web Design and Development | Twitter

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

8 Jun 2009, 2:30 AM
#125
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

noobuser:

hello,
when the script runs it keeps failing. I am with GoDaddy hosting service. Anybody here with similar issue?

much appreciate your help.

get a decent hosting service...GoDaddy sucks. try a2z-4u.com

12 Jun 2009, 4:29 PM
#126
schtoo avatar

schtoo

New Zenner

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

Re: Currency Update (Automatic)

Got one for you.

The mod itself works if I access it through a browser window, no trouble at all.

The problem is that the cron job can't open the file.

The email log I get says: Could not open input file: home/username/public_html/zencart/includes/currency_update.php

(Names changed to protect the guilty)

Temporarily stuck there until I can get it working properly.

Chmod is 777, its in the spot it should be obviously and it does actually work, but the cron job won't make it happen.

Any suggestions, or should I bounce this off the hosting service?

Thanks, I hope...

13 Jun 2009, 2:05 PM
#127
schtoo avatar

schtoo

New Zenner

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

Re: Currency Update (Automatic)

Got it working, very simple in the end (isn't it always?)

Just so anyone out there gets into the same predicament as your truly, here is how it works if you are using Currency Update 3.1 'curled' and happen to be using cpanel for your site's back end adjustments.

Go to 'cron jobs', select 'standard' (because it's the easiest way to go), enter an email address for the cronjob logs (not required, but useful to pin point problems, just set up an email address for it) and then type

"curl http://www.yoursite.com/locationofcurrencyupdatefile/currency_update.php"

Set a time for scheduling, as recommended here, once a day is sufficient.

Save the crontab and you are done.

Take care to leave the space between 'curl' and the full i.p address of where you have put the currency_update.php file. You can also leave the file itself as currency_update_curled.php and it shouldn't make any difference.

Make really sure that in the currency_update.php file your full paths are accurate, both for where the currency_update.php file is, where the store's root file is and the two files it needs access to. If you hit trouble, enter the FULL path for the two files, 'includes/configure.php' and 'includes/database_tables.php' like this...

// This describes the path from the location where you install this file to the root directory of your Zen Cart
// It is normally the only line that you will need to edit. See readme for guidance.
DEFINE('/home/username/public_html/whereyourfileis/','/home/username/public_html/zencart/');

/ Get Zen Cart configuration data
require_once('/home/username/public_html/zencart/includes/configure.php');
require_once('/home/username/public_html/zencart/includes/database_tables.php');

'Path' is just like the above, home/username/public_html/zencart/etc/etc.

Address is http://www.example.com/etc.php

A sucessful cronjob will return an email to you that looks something like this.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

An unsucessful one will give you something else, but going with the above method seems to be nearly bulletproof, if only because I have tried dozens of other ways to get it working, and this is the only way that did it.

I hope that helps someone out there who gets stuck, and I wonder why a know nothing like me had to find out how simple it was after persuing all other methods...

15 Jun 2009, 2:35 PM
#128
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Re: Currency Update (Automatic)

G'day,

I've just installed this mod and it seems to be working just fine.

My store is running an earlier version of Zen Cart that doesn't have the Currency Conversion Ratio value defined. Thus I changed the appropriate lines in currency_update.php to:

//get currency conversion ratio
// $currency_uplift_ratio =  mysql_db_query(DB_DATABASE, "select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key='CURRENCY_UPLIFT_RATIO' LIMIT 1 ", $link);
// $currency_uplift_ratio = mysql_fetch_array($currency_uplift_ratio);
// define('CURRENCY_UPLIFT_RATIO', $currency_uplift_ratio[0]); 
define('CURRENCY_UPLIFT_RATIO', 1.0000); 

On my setup I receive an email when a Cron job runs.

It would be nice if currency_update.php actually output the currency exchange values used to update the store table. Then I'd receive this information in the daily email. It would serve as a documentation record of what exchange values were in place at what given times in the store.

Cheers, Lloyd Borrett.

Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

17 Jun 2009, 3:16 AM
#129
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Currency Update (Automatic)

Struggled for a few hours read all the threads, but I still cant make it work a point in the right direction would be very appreciated..

Zen Version 138a with automated_currency_update_v3_1
**
The error report**

Warning: require_once(home/www/adulttoys4u.com.au/shop/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required 'home/www/adulttoys4u.com.au/shop/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20
**
What I did as the path (amongst numerous other combination's) **

these are line 17-21

DEFINE('PATH_TO_STORE_ROOT','home/www/adulttoys4u.com.au/shop/');

// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');

Thanks

17 Jun 2009, 8:05 PM
#130
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

Renz:

Struggled for a few hours read all the threads, but I still cant make it work a point in the right direction would be very appreciated..

Zen Version 138a with automated_currency_update_v3_1
**
The error report**

Warning: require_once(home/www/adulttoys4u.com.au/shop/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required 'home/www/adulttoys4u.com.au/shop/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20
**
What I did as the path (amongst numerous other combination's) **

these are line 17-21

DEFINE('PATH_TO_STORE_ROOT','home/www/adulttoys4u.com.au/shop/');

// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');

Thanks

It's all in the instructions....read them carefully
PATH_TO_STORE_ROOT

// This describes the path from the location where you install this file to the root directory of your Zen Cart
// It is normally the only line that you will need to edit. See readme for guidance.

The keyword here is from. Don't give the total path of the server to your store..give the path from where you install the file. I.E. if the file is in the root of your store then you only need '/'. If it is down one folder in say admin then you need '/admin/'. Leave everything else alone.

Additionally I doubt the total path includes your domain name. Linux server normally shorten this to only maximum 8 characters...at a guess yours might be 'adulttoy' not 'adulttoys4u.com.au'..but its irrelevant anyway.......as you don't need the total path....

17 Jun 2009, 11:17 PM
#131
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Currency Update (Automatic)

Thanks for your help, I tried the following and still I am not there, I am sure the answer is simple and yet nothing for me....as I am still struggling..


Ok the file is currency_update.php it is now located in
https://www.adulttoys4u.com.au/shop/currency_update.php. Yet I cannot call it by the url either and get this error messege.

Warning: require_once(/shop/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/shop/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20


This is the line I amended as per your instructions

DEFINE('PATH_TO_STORE_ROOT','/shop/');

// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');


The Host control panel gives an example which shows I have to set the cron job up ...like this

rn /home/www/adulttoys4u.com.au/shop/currency_update.php/*

Thanks again.

19 Jun 2009, 3:33 AM
#132
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

Renz:

Thanks for your help, I tried the following and still I am not there, I am sure the answer is simple and yet nothing for me....as I am still struggling..


Ok the file is currency_update.php it is now located in
https://www.adulttoys4u.com.au/shop/currency_update.php. Yet I cannot call it by the url either and get this error messege.

Warning: require_once(/shop/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/shop/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20


This is the line I amended as per your instructions

DEFINE('PATH_TO_STORE_ROOT','/shop/');

// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');


The Host control panel gives an example which shows I have to set the cron job up ...like this

rn /home/www/adulttoys4u.com.au/shop/currency_update.php/*

Thanks again.

Don't put the slash before 'shop/'

Try:

**DEFINE('PATH_TO_STORE_ROOT','shop/'); **

19 Jun 2009, 4:34 AM
#133
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

Renz:

Thanks for your help, I tried the following and still I am not there, I am sure the answer is simple and yet nothing for me....as I am still struggling..


Ok the file is currency_update.php it is now located in
https://www.adulttoys4u.com.au/shop/currency_update.php. Yet I cannot call it by the url either and get this error messege.

Warning: require_once(/shop/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/shop/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20


This is the line I amended as per your instructions

DEFINE('PATH_TO_STORE_ROOT','/shop/');

// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');


The Host control panel gives an example which shows I have to set the cron job up ...like this

rn /home/www/adulttoys4u.com.au/shop/currency_update.php/*

Thanks again.

But if the root of zen is in 'shop' and currency update is in 'shop' then all you need is a slash. remember 'PATH_TO_STORE_ROOT' is where is zen's root (not necessarily your websites root.) relative to currency_update.php

for cron this sort of thing works for me:

php -q /home/www/adulttoys4u.com.au/shop/currency_update.php

19 Jun 2009, 4:51 AM
#134
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi KES99

I do so appreciate your efforts, though nothing has still worked, I have tried everything you suggested..

DEFINE('PATH_TO_STORE_ROOT','shop/');

gave me this
Warning: require_once(shop/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

& this DEFINE('PATH_TO_STORE_ROOT','/');

gave me
Warning: require_once(/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/includes/configure.php' (include_path='.:/usr/local/php5/lib/php') in /home/www/adulttoys4u.com.au/shop/currency_update.php on line 20


Just to clarify the shop file that all other files are in used to be called catalogue from the original zen cart installs..it is sat there on its own it is not in home or www or public ...

I look fwd to your next suggestion..kind regards..

19 Jun 2009, 5:00 AM
#135
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Currency Update (Automatic)

Err just a thought are the file permissions at all relevant in this issue.

19 Jun 2009, 11:13 PM
#136
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

Renz:

Hi KES99
Just to clarify the shop file that all other files are in used to be called catalogue from the original zen cart installs..it is sat there on its own it is not in home or www or public ...

Don't understand...have you renamed the folder from catalogue to shop?

19 Jun 2009, 11:31 PM
#137
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

Renz:

Err just a thought are the file permissions at all relevant in this issue.

They may be.....where exactly is configure.php and what file permissions do you have on it and the folder it's in.

and if zen is "on its own it is not in home or www or public ..." exactly where is it?

20 Jun 2009, 2:09 AM
#138
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi KES99

Yes I have renamed the catalogue to shop. The configure folder is where it supposed to be. (the original file structure)

/shop/includes/configure.php

write permissions are as suggested by security procedures for zen item number 3 set configure.php to read only 444

Do you suggest I create a folder called www and drop the shop into it?

Cheers

RR

20 Jun 2009, 11:16 AM
#139
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Currency Update (Automatic)

chdir(dirname(FILE));
DEFINE('PATH_TO_STORE_ROOT', dirname(FILE) . '/');

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

21 Jun 2009, 1:57 AM
#140
kes99 avatar

kes99

New Zenner

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

Re: Currency Update (Automatic)

Renz:

Hi KES99

Yes I have renamed the catalogue to shop. The configure folder is where it supposed to be. (the original file structure)

/shop/includes/configure.php

write permissions are as suggested by security procedures for zen item number 3 set configure.php to read only 444

Do you suggest I create a folder called www and drop the shop into it?

Cheers

RR

Personally I wouldn't have renamed anything. Too many things can and often do go wrong when you change the location of an installed item such as zen. Best is to install it where you want it and leave it alone.

I also wouldn't make a www folder. If you're on a linux/apache system www is often part of your path from the servers root. Actually it is often a link to public_html (the real root of your domain). You might really confuse things in having 2 www's.

Permission of 444 is correct.

Please check your message box for a PM from me.

Try the other solution suggested here by a_berezin. Other than that I'm stumped unless you reply in the afirmitive to my PM.