Currency Update (Automatic)
This contribution was already posted by myself on the forums a long time ago, but it seems to be lost for the newer zenners not knowing about it.
Here is a link to this mod: Automatic Currency Update.
This script is designed to run via cronjob within certain interval you may/must set. Once done, the script will check oanda.com or xe.com server with the current conversion rate and update your store.
This is extremely useful, if you don't click on the update button every hour :wink2:
Installation is very easy - just drop in the file and set the directory path to your Zen-Cart setup, if this script is not running in your Zen-Cart's folder. After that, set up the cronjob.
This is one of the wonderful set it & forget it options that are quite useful to have!
Re: Currency Update (Automatic)
Hello! Can you tell me what I should put in when I'm doing the cron job and it asks for the Command to run? Also, should I be choosing the Standard or Advanced (Unix) mode when doing the cron job?
Thanks!
Re: Currency Update (Automatic)
Standard or Advanced one is self explaining. If you were in expert in this (cronjob) area, then ofcourse you would be choosing the advancded one, but I guess you wouldn't be asking.
The command to run is just the complete file path to this update script. A real "advancded" command is like this
Quote:
30 * * * * /full/path/to/cron/script/file.php
which runs every 30 mins. In the normal view, you are given the option to let the xpanle generator set up the complete command to run (additional to the file path).
Re: Currency Update (Automatic)
Thank you! So I can use the Standard mode and just put http://www.mysite.com/currency_update.php or wherever my script is located?
Re: Currency Update (Automatic)
Hmmm it's not working. It sends an e-mail each times it runs and says this: /bin/sh: line 1: http://www.babyplanet.ca/currency_update.php: No such file or directory
But the file is there...
Re: Currency Update (Automatic)
You will have to use the exact system file path to this file. You shouldn't be using the web location in your cron.
It should be something like this
/var/www/~user123/html/file.php
Re: Currency Update (Automatic)
Hmmm OK, I did that, then it said permission was denied, oops! So I set the permissions to 777. Now the e-mail that comes says this:
/home/dburgi2/public_html/currency_update.php: line 1: ?php: No such file or directory
/home/dburgi2/public_html/currency_update.php: line 2: /*: No such file or directory
/home/dburgi2/public_html/currency_update.php: line 3: //Currency: No such file or directory
/home/dburgi2/public_html/currency_update.php: line 4: //developed: No such file or directory
/home/dburgi2/public_html/currency_update.php: line 5: //donations: No such file or directory
/home/dburgi2/public_html/currency_update.php: line 6: //via: No such file or directory
/home/dburgi2/public_html/currency_update.php: line 7: syntax error near unexpected token `('
/home/dburgi2/public_html/currency_update.php: line 7: `//every little bit helps - why donate (http://www.modyourzencart.com/free-of-charge/why-donate)'
And the currencies aren't updating.
Re: Currency Update (Automatic)
Does anyone have this working successfully who would like to share how they did it :D
Thanks!!!
Re: Currency Update (Automatic)
You will need to talk to your host - it would seem that they do not allow the execution of php files via cron.
My server requires "nice -15 curl http://www...etc"
But this updater certainly works.
Re: Currency Update (Automatic)
Oh OK, I'll ask them, thank you! Nice to know that maybe it's not just something I'm doing wrong :blush: I have seen tons of posts from others who seem to have it working fine, so I don't at all think it's a problem with the mod itself, I was just hoping someone here had a similar experience and still got it working!
So if it is my host, I will have to set it up differently somehow to make it work?