Results 1 to 10 of 298

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    I am new to zencart. I have just installed v1.3.9h . I am trying to install Currency Update (Automatic) v4 . My host does not allow cronjob. If i place the file in the folder includes/auto_loaders will it run? (define('PATH_TO_STORE_ROOT','www/zen139-1/includes/auto_loaders/');) I tried this but nothing what am i doing wrong?

    thank you in advance

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by bioreactor View Post
    I am new to zencart. I have just installed v1.3.9h . I am trying to install Currency Update (Automatic) v4 . My host does not allow cronjob. If i place the file in the folder includes/auto_loaders will it run? (define('PATH_TO_STORE_ROOT','www/zen139-1/includes/auto_loaders/');) I tried this but nothing what am i doing wrong?

    thank you in advance
    As far as I know you will need a cron job to execute the file automatically at a given time of the day. Placing the file in the folder includes/auto_loaders will not do the trick.

    You may want to talk to your host and see if they can set up a cron for you.

  3. #3
    Join Date
    Dec 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by frank18 View Post
    As far as I know you will need a cron job to execute the file automatically at a given time of the day. Placing the file in the folder includes/auto_loaders will not do the trick.

    You may want to talk to your host and see if they can set up a cron for you.
    Thank you very much for you precious help

    I justed hoped that ther was also another way except for cronjob

  4. #4
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    A very old thread but a wonderful mod!

    Having gone through almost every post, I was struggling to understand how it should be set up. I sent a support ticket to Bluehost but haven't received a reply yet. So, I decided to give it a try until a reply was received.

    I have Zen Cart 1.3.9h installed in my root directory and wanted to install the Automatic Currency Updater version 4.0. Based on what I read in the posts above and Bluehost's help files on how to set up a cron job:

    I placed the currency_update.php unmodified in my public_html folder. When entering http://athenscollectibles.info/currency_update.php in the browser, I got a blank page which, assuming from earlier posts, is what I should get. When I changed line 20 to define('PATH_TO_STORE_ROOT','/'); (i.e. with an added / between the single quotes), I got the following error:

    Warning: require_once(/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home3/MY_USER_NAME/public_html/currency_update.php on line 23

    Fatal error: require_once() [function.require]: Failed opening required '/includes/configure.php' (include_path='.:/usr/lib64/php:/usr/lib/php') in /home3/MY_USER_NAME/public_html/currency_update.php on line 23

    I removed the / and everything went back to normal, so I left it like this.

    Now, setting the cron job: as per Bluehost's help files, I entered the command:

    /ramdisk/bin/php5 -c /home3/MY_USER_NAME/public_html/currency_update.php

    and set it to run every minute (that's just to see what happens, I will change the frequency after making sure that everything works fine).

    The rates were updated quickly and correctly (but see below about rounding). To test the system again, I updated the rates from the Admin > Localization > Currencies which brought up the oanda rates. These soon changed back to the ECB rates, proving that the mod and the cron job function correctly.

    So far, so good. However, the auto email I get when the cron job runs, reads:

    PHP: Error parsing /home3/MY_USER_NAME/public_html/currency_update.php on line 1
    X-Powered-By: PHP/5.2.14
    Content-type: text/html

    Line 1 of the currency_update.php file reads:

    #!/usr/bin/php

    I don't know php but thought of changing the first line of the file to
    #!/ramdisk/bin/php5 (in line with the cron job command as above) and see what happens. Unfortunately, I still got the same error in the email, so I restored the original line 1.

    Although the exchange rates are published with 4 decimal places on the ECB web site, they are entered with 8 decimals in my currencies. I assume that the ECB file used to pull the rates has indeed 8 decimal places but they are displayed with 4 decimal places on the web site or is there another reason?

    For example, with EUR as my base currency, rates are as follows:

    [FONT="Courier New"]USD 1.3472 1.34720004
    GBP 0.8436 0.84359998
    CAD 1.3463 1.34630001
    AUD 1.3583 1.35829997[/FONT]

    The first column shows the rates as published by ECB, the second as they are entered in my currencies. Is this something normal and not to be concerned about?

    I wonder if someone can help in eliminating the above error message in emails and advising about the exchange rates decimals.

    Any help will be greatly appreciated and my thanks are expressed in advance. Apologies for the very long post, which could possibly be of help to other Bluehost users.

  5. #5
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Update to the previous post

    The above procedure was not correct (!)

    It seems that the rates were updated when I run the file from my browser, not with the cron job. Finally, I found the solution.

    The correct cron job command, as instructed by Bluehost, should have been

    [FONT="Courier New"]/ramdisk/bin/php5 -c /home3/MY_USER_NAME/public_html/php.ini /home3/MY_USER_NAME/public_html/currency_update.php[/FONT] and I had deliberately omitted the middle part as there was no php.ini file in my home directory. This was most probably responsible for the error message in the email and for the cron job not running.

    I installed a master php.ini file in my home directory by selecting php Config from the Software/Services section of the cPanel and that seems to have done the job: the email now reads

    X-Powered-By: PHP/5.2.14
    Content-type: text/html

    and the rates are updated normally. I tested it repeatedly by updating the rates from oanda, waiting for the cron job to run and seeing them changing within a minute (I still have the cron job to run every minute).

    End of story for me.

    Note: /home3/MY_USER_NAME is the name of my home directory. A user's home directory is displayed on the left side of cPanel in the Stats section.

  6. #6
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    A last note to say that the mod works perfectly for the last few hours and to express my thanks to those who created and enhanced it. Great job and far better than the default Zen Cart manual update of exchange rates.

    Thank you all.

 

 

Similar Threads

  1. Automatic Currency Updates - curl version problem
    By mtimber in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 10 Dec 2008, 07:53 PM
  2. Automatic Currency Selection for a domain
    By [email protected] in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 5 Jun 2007, 09:38 AM
  3. Automatic Currency Updates
    By dustyservers in forum Customization from the Admin
    Replies: 6
    Last Post: 28 Jun 2006, 12:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg