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

Currency Update (Automatic)

Views: 82,431

Results 41 to 60 of 298
17 Aug 2008, 10:33 AM
#41
dayo avatar

dayo

Zen Follower

Join Date:
Dec 2006
Posts:
187
Plugin Contributions:
1

Currency Update (Automatic)

It should work OK so no need to be wary. As long as you have no issues with running a php script with cron as I had.

I am in the final stages of making a variant of this that doesn't rely on traditional cron jobs to update the currencies and also adds yahoo finance in a way that doesn't rely on page scraping. (page scraping as currently used by the currency update functions in zencart is vulnerable to changes in page layout).

I am just waiting to see what actions the site admins take on existing contributions following a rather bizarre email full of what I think are unnecessary prescriptions on dos and donts they recently circulated to people that have contributed in the past.

The email contained a ultimatum to comply within 30 days with unspecified consequences.

If they start applying heavy handed censorship as the email suggested might be the case, then I guess I will have to review the point of uploading contributions.

One important point of open source is freedom to code as desired not marching to some totalitarian tune.

So, in summary, you should be able to use the existing contribution or keep a lookout for an improved version which will come depending on the way the site admins decide to go.

21 Aug 2008, 9:07 AM
#42
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

looks like Curled version works for me
With the following location inserted into file:

'/var/www/vhosts/mywebsite.com/httpdocs/'

5 Sep 2008, 2:35 PM
#43
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

I'm a real newbie, and would appreciate any help.

I've contacted our hosts, and they can set the cronjob up for me. I've got the file currency_update.php uploaded to the following folder /var/www/html/includes/ and have given these details to the host, and asked for it to be run once a day. Is this folder a goodplace toput the file?

They also wanted the name of the script, what should I give them?

Regrading the file - currency_update.php, I do not understand fully from the instructions what changes I need to do to this file.

The instructions say:

"Edit line 13 to define the path from the lcoation where you plan to put the file, to root directory for your store."

Line 13 is:

// and is normally the only line that you will need to edit

I presumbe it is line 14 that I need to change which is:

$location = './'; // location of zen-cart intall

but what do I need to change exactly?

6 Sep 2008, 10:47 AM
#44
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

My line 14 looks like
$location = '/var/www/vhosts/xxxxxx.com/httpdocs/'; // location of zen-cart intall

17 Sep 2008, 9:32 AM
#45
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

What should the CMOD be for file currency_update.php ? I have set it to 775 and get the error message when accessing the filethrough my browser:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.The file is located in my root folder:

http://www.domainofcompany.com/currency_update.php

I have inserted the following in the file as location of Zen Cart install:

 $location = '/home/virtual/domainofcompany.com/var/www/html/'; // location of zen-cart intall
```My host can setup the Cronjob, but say that there is no point as the script doesn't work. I would really appreciate any help!
17 Sep 2008, 8:57 PM
#46
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

I get the following error message. Can anyone help?

PHP Warning: require_once(/home/virtual/companydomain.com/var/www/html/includes/configure.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/html/currency_update.php on line 21

PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/virtual/companydomain.com.com/var/www/html/includes/configure.php' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/currency_update.php on line 21

19 Sep 2008, 9:09 AM
#47
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

Can anyone help with this please? :dontgetit

22 Sep 2008, 2:10 PM
#48
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

Any help please?? Sorry for asking again but I'm desperate to get this working. What am I doing wrong?

22 Sep 2008, 11:12 PM
#49
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

I tried numerous times to get currency update to work but then I finally tried the curled version. with file uploaded to root directory.

It works ok now. I changed my location of file as I mentioned in post 44 above. Then ran the url and currency update is OK. Then I setup a cronjob to fully automate it further.

If you have problems setting up the currency update try the curled version it worked for me.

23 Sep 2008, 9:58 AM
#50
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

whitt:

I tried numerous times to get currency update to work but then I finally tried the curled version. with file uploaded to root directory.

It works ok now. I changed my location of file as I mentioned in post 44 above. Then ran the url and currency update is OK. Then I setup a cronjob to fully automate it further.

If you have problems setting up the currency update try the curled version it worked for me.

Thanks for your tips. Unfortunately it hasn't worked for me :dontgetit

The curled version gives out the same error. I do not understand the error myself, but it seems to suggest that there is a problem with /includes/configure.php ??

23 Sep 2008, 12:30 PM
#51
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

i think you may still have problems with the path?

26 Sep 2008, 11:46 AM
#52
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Currency Update (Automatic)

whitt:

i think you may still have problems with the path?

Many thanks for that tip. It was the problem!

My host told me to use:

'/home/virtual/domain.com/var/www/html/

Where I insert my domain where it is bold above. But I checked my ftp, and that wasn't the path I was getting, it was the following:

'/home/myusername/mainwebsite_html/'

Where I unser my usernamein the area marked as bold above. I've added the above, and the script works great.My host will now set up a Cron Job to run once a day.

How often has the rest of you set the cron job to execute the script? Should I ask to change it to happen more often than once a day? After all, the price in the other currencies is only a guide, and I have marked this clearly on our site!

26 Sep 2008, 11:58 AM
#53
kuroi avatar

kuroi

Totally Zenned

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

Re: Currency Update (Automatic)

Prices in a currency other than your store's default are only guides if you don't actually allow them to purchase with those currencies. If you do allow purchases with these currencies then they are the actual amount that they will pay, not guides.

This is why Zen Cart has an a currency conversion ratio. It's set high by default (5%), which can make your product prices uncompetitive. If you're not allowing purchases in these currencies or want to price more competitively, I would recommend reducing the conversion ratio and increasing the frequency of the CRON job.

There's very little processing penalty to this. I have a client running it every hour on the half hour.

Kuroi Web Design and Development | Twitter

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

26 Sep 2008, 12:01 PM
#54
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

mine updates once a day and i adjusted the 5% LOWER

5 Oct 2008, 6:43 PM
#55
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Currency Update (Automatic)

Hi,

Another possible reason for the cron job not working is that the cron command may have to reference php with an absolute path.

For example on my hosting server this command:

php /home/username/public_html/path/currency_update.php

gets passed to the interpreter so it appears to be working but then results in the script stopping when it tries to connect to the database with:

PHP Fatal error: Call to undefined function mysql_connect() in /home/username/public_html/path/currency_update.php on line 25

In fact the cron command needs to have the full path to php,

eg.

/usr/lib/php /home/username/public_html/path/currency_update.php

Embarrassingly I wasted ages discovering this as I have no experience with UNIX, but a question for those of you who do have UNIX server experience: is this thing about the full path common knowledge and totally obvious to all but the newly-born/senile? I ask because my hosting support did not spot this and I was wondering if they should have.

Regards
Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

21 Oct 2008, 7:53 PM
#56
harry2cool avatar

harry2cool

Zen Follower

Join Date:
Oct 2005
Posts:
280
Plugin Contributions:
0

Re: Currency Update (Automatic)

I have noticed that this mod uses the currency rate which is higher (Oanda.com) , I would like this mod to use to use XE.com as it's primary for updates, this is what the script is designed for.

How do I get only the XE.com currency update and use the Oanda.com only as a backup .

Does the script use the higher currency update if yes how can I change this.

27 Oct 2008, 4:27 AM
#57
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: Currency Update (Automatic)

I have the mod installed.

My host provider told me to use:

/usr/bin/php /home/(directory)/currency_update.php

I have the Cron job set to run every 4 hours. Does anyone have a suggestion about this?

18 Nov 2008, 3:52 AM
#58
p1drobert avatar

p1drobert

New Zenner

Join Date:
May 2007
Location:
Melbourne, Australia
Posts:
88
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi,

Is there another way to schedule the currency_update.php file to run, besides using cron jobs. My host wants $55 to set up the cron job. Apart from the money issue I'd prefer to keep control of my web site. Depending on others to make changes for me puts me at a disadvantage.

18 Nov 2008, 4:04 AM
#59
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Currency Update (Automatic)

Do the currencies your site deals with actually change that frequently with a variance that's so drastic it requires real-time updating? Most of the time it's pretty safe to update it once a week manually, according to markets and your own needs.

And ... a hosting company that wants to charge $55 to set up a cron job ... is ripping you off. There are many hosting companies out there that let you do that yourself from within your hosting control panel for no extra charge. The Certified Hosts list at the top of this page shows a few such companies. If you are considering one of them, be sure to ask them about your specific question when doing your research before signing up.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Nov 2008, 5:42 AM
#60
p1drobert avatar

p1drobert

New Zenner

Join Date:
May 2007
Location:
Melbourne, Australia
Posts:
88
Plugin Contributions:
0

Re: Currency Update (Automatic)

DrByte:

Do the currencies your site deals with actually change that frequently with a variance that's so drastic it requires real-time updating? Most of the time it's pretty safe to update it once a week manually, according to markets and your own needs.

And ... a hosting company that wants to charge $55 to set up a cron job ... is ripping you off. There are many hosting companies out there that let you do that yourself from within your hosting control panel for no extra charge. The Certified Hosts list at the top of this page shows a few such companies. If you are considering one of them, be sure to ask them about your specific question when doing your research before signing up.

Hi Drbyte.

Normally once a week would be ok, but the world is in panic mode at the moment. The Australian dollar has dropped from 85c US to around 60c in the past month and its jumping all over the place. I can manually do it once a day, but the weekends I'm away from the office.

My host, is fairly cheap and reliable. Despite them trying to gouge me this time I'm pretty pleased with them. But having briefly researched cron jobs before hand it didn't seem right to charge $55 for what seems to be a simple matter.