Re: Currency Update (Automatic)
Hi All,
I have now tried changing the original file DEFINE('PATH_TO_STORE_ROOT','shop/'); to what Andrew Berezin suggested as per below,
Quote:
Originally Posted by
a_berezin
chdir(dirname(__FILE__));
DEFINE('PATH_TO_STORE_ROOT', dirname(__FILE__) . '/');
The result now is upon calling the url http://www.adulttoys4u.com.au/shop/currency_update.php that I get a complete blank page and no errors...at all....So is this what is supposed to happen? I am not sure as there was no confirmation of anything, I run it and then then I run it again from the CP and I got different exchange rates but only by a few cents I am thinking thats because it updated from OANDA in the CP and from here http://www.ecb.europa.eu when called by the url..
Sooo Does it mean that If I go ahead and set the next stage IE the cron job now the currencies will be auto updated...
Cheers
Nearly there, Thanks KES99 I did get your PM hold that thought I think we are happening...
Re: Currency Update (Automatic)
The file outputs nothing. This is deliberate, since it's designed to be run quietly and automatically as a script, not as a web page. So there would be nowhere in normal operation for any output to go.
The way I test it personally, is to tweak the currency rates in the database and then run it in a browser as you have and look in the database to see if they're changed. Then change them again and setup a CRON job for a few seconds into the future and look to see if they've changed. If those work then I set the CRON job to daily shortly after the official update time and check the results the next day.
Re: Currency Update (Automatic)
:clap: Yeahiii that's fixed it and it all works just fine, (thanks for the code Andrew Berezin, I tested it like you suggested Kuroi and thanks to Kes 99 for your efforts.
PS Kuroi what is the GMT of the official currency update time.
Thanks
Regards
RR
Re: Currency Update (Automatic)
:(:(:(
I am so sad. This is a great bit of code, but for the longest time I was getting a "Division by Zero" error when it would run, and the site would set everything to zero (except for the default currency) when i tried to update. What was the problem?
Well, I finally figured it out. The problem is that I am in South Korea, and the default currency is Won.
The ECB doesn't include the Korean Won in it's XML datafeed - even though they have it right there on the website.
I spent SOOOOOOOOO long trying to get this to work. But I think I'm SOL unless the ECB changes it's data feed. In the meantime, I will try installing 2.0
:cry:
Wish me luck!
Re: Currency Update (Automatic)
Sorry, I'm an idiot.
Living in Korea, you'd think I would know that the Won is KRW, not WON.
I got spoiled by Google currency converter allowing me to type WON.
Everything is working like a million bucks with 3.1!
:D:D:D
Quote:
Originally Posted by
buddhaflow
:(:(:(
I am so sad. This is a great bit of code, but for the longest time I was getting a "Division by Zero" error when it would run, and the site would set everything to zero (except for the default currency) when i tried to update. What was the problem?
Well, I finally figured it out. The problem is that I am in South Korea, and the default currency is Won.
The ECB doesn't include the Korean Won in it's XML datafeed - even though they have it right there on the website.
I spent SOOOOOOOOO long trying to get this to work. But I think I'm SOL unless the ECB changes it's data feed. In the meantime, I will try installing 2.0
:cry:
Wish me luck!
Re: Currency Update (Automatic)
OK, still :(. Haha. My host is not being a lot of help.
When I execute the script from a browser, it works fine.
When I execute through cron -
/home6/blahblah/public_html/currency_update.php: line 1: ?php: No such file or directory
/home6/blahblah/public_html/currency_update.php: line 2: /1,: Permission denied
/home6/blahblah/public_html/currency_update.php: line 3: access-logs: command not found
/home6/blahblah/public_html/currency_update.php: line 4: syntax error near unexpected token `('
/home6/blahblah/public_html/currency_update.php: line 4: ` * Originally by Richard Fink (masterblaster) based on Zen Cart manual currency update'
Whatever could be the problem? It doesn't seem to be interpreting as PHP at all. Any advice is greatly appreciated...
Thank you,
Sasha
Re: Currency Update (Automatic)
Quote:
Originally Posted by
buddhaflow
OK, still :(. Haha. My host is not being a lot of help.
When I execute the script from a browser, it works fine.
When I execute through cron -
/home6/blahblah/public_html/currency_update.php: line 1: ?php: No such file or directory
That sounds as though the CROM job is losing the opening "<" that forms part of the opening <?php tag. Thiough I'm sorry but I have no idea why it might do that.
Re: Currency Update (Automatic)
I'm not sophisticated enough to know why, but for some reason PHP had to be given the path to the PHP interpreter. Simply putting in:
#!/usr/local/bin/php -q
as the first line of the .php file cleared it right up :)
Re: Currency Update (Automatic)
Hi, there
I have used this script in my crob job: /usr/bin/curl /***/***/public_html/includes/currency_update_curled.php
But the return in email is: curl: (3) <url> malformed
What's wrong and how to deal with?
Any help would be highly appreciated.
All the best,
Re: Currency Update (Automatic)
Hi, there
After 2 support ticket with bluehost, I got it done.
They use '/ramdisk/bin/php5 /home/...' as you input into the command to perform in cron job standard area.
All the best,