Page 24 of 30 FirstFirst ... 142223242526 ... LastLast
Results 231 to 240 of 298
  1. #231
    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.

  2. #232
    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.

  3. #233
    Join Date
    Dec 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by kuroi View Post
    Earlier versions of this mod used oanda and xe. However, they changed they terms of use to outlaw screen scrapping. So the mod was changed to the ECB feed to keep it legal.
    Quote Originally Posted by kuroi View Post
    The difference is that the admin script was written in 2006, before the terms of use were changed. Earlier versions of the mod were based on that code.
    Quote Originally Posted by Troll View Post
    Still don't understand the legal thingy though...I don't understand that including an old script to a new version makes it legal
    This one has me scratching my head as well.

    As far as I can see, the older versions of the mod were exactly the same as the script in the ZC admin adjusted so it could run outside the ZC environment. How can the code in the older versions of the mod be illegal and that in the ZC admin be legal?

    I understand the ZC admin code was written in 2006 before the change of the TOS on the sites but that does not seem to be a reasonable explanation with respect to new releases.

    So can one of the devs please clarify whether the currency update code in the ZC Admin is legal or not with regards to the TOS of the sites used for updates? If it is, I can't see how the code in the older versions of this mod could have been illegal.

    Just trying to see whether to continue using the older (illegal?) version since it covers currencies not covered by the ECB.

    Thanks.

  4. #234
    Join Date
    Dec 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by nithinalex View Post
    I was checking Automatic Currency Updater version 4.0 extension ...and found that currency conversion feed from European Central Bank's website do not contain Middle East Asian countries like UAE, Saudi Riyal, Kuwait Dinar etc Exchange rates...... So what to do for getting Currency Exchange rates from such Gulf countries??? .......
    I live in Bahrain and our currency is not covered either.

    There is some confusion as to legalities but if the code in the Zencart admin is legal, then this is legal as it is taken directly from there

    Code:
    <?php
    /**
     * @package admin
     * @copyright Copyright 2003-2009 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: currencies.php 15074 2009-12-10 03:04:31Z drbyte $
     */
    
    /* Code below from admin/currencies.php in Zencart 1.3.9h */
      require('includes/application_top.php');
      require(DIR_WS_CLASSES . 'currencies.php');
      $currencies = new currencies();
          case 'update_currencies':
            $server_used = CURRENCY_SERVER_PRIMARY;
            zen_set_time_limit(600);
            $currency = $db->Execute("select currencies_id, code, title from " . TABLE_CURRENCIES);
            while (!$currency->EOF) {
              $quote_function = 'quote_' . CURRENCY_SERVER_PRIMARY . '_currency';
              $rate = $quote_function($currency->fields['code']);
      
              if (empty($rate) && (zen_not_null(CURRENCY_SERVER_BACKUP))) {
                // failed to get currency quote from primary server - attempting to use backup server instead
                $messageStack->add_session(sprintf(WARNING_PRIMARY_SERVER_FAILED, CURRENCY_SERVER_PRIMARY, $currency->fields['title'], $currency->fields['code']), 'warning');
                $quote_function = 'quote_' . CURRENCY_SERVER_BACKUP . '_currency';
                $rate = $quote_function($currency->fields['code']);
                $server_used = CURRENCY_SERVER_BACKUP;
              }
      
              /* Add currency uplift */
              if ($rate != 1 && defined('CURRENCY_UPLIFT_RATIO') && (int)CURRENCY_UPLIFT_RATIO != 0) {
                $rate = (string)((float)$rate * (float)CURRENCY_UPLIFT_RATIO);
              }
    
              // special handling for JPY, which always uses whole numbers, never decimals
              if ($code == 'JPY') {
                $rate = (int)$rate;
              }
      
              if (zen_not_null($rate) && $rate > 0) {
                $db->Execute("update " . TABLE_CURRENCIES . "
                              set value = '" . $rate . "', last_updated = now()
                              where currencies_id = '" . (int)$currency->fields['currencies_id'] . "'");
              }
              $currency->MoveNext();
            }
      /* relevant section from includes/application_bottom.php in Zencart 1.3.9h */
      session_write_close();
    ?>
    Save it as a php file under your ZC folder (choose any name apart from currency_update so that wreckers do not keep firing it off) and set up the cron job as explained elsewhere in this thread. Covers every currency just like the ZC admin does.

  5. #235
    Join Date
    Dec 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by Dayo View Post
    Save it as a php file under your ZC folder ... and set up the cron job as explained elsewhere in this thread.
    Sorry. My code above will not work. Creating a spin off from this module based on the core Zencart code and functions in the Zencart admin which would similarly cover all currencies.

  6. #236
    Join Date
    Dec 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Currency Update (Automatic)

    Done the spin off version

    PREAMBLE:
    It is basically the same as the earlier versions of this module with minor updates but being given a new name since this module has developed to use ECB Reference Rates which only cover a limited set of currencies (Major Currencies Only) due to what appears to be concerns with the legality of the earlier versions.

    The spin-off version returns to using the functions shipped with Zencart and is based on the assumption that if that code is legal, this must be as all it does is hook into the relevant Zencart functions as used by the core code.

    USAGE:
    Save the code into a php file and upload to your Zencart Admin folder. (No need to edit anything as it just hooks into ZC Functions)
    Set up a cron job to call the file.

    You can get the code here: http://www.zen-cart.com/forum/showthread.php?t=173176

  7. #237
    Join Date
    Sep 2010
    Posts
    612
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    HELP! HELP!

    I'm losing my mind with this mod. I have managed to set up the cronjob, it runs and I get not errors in my email. However, the rates don't update? I've tried to change to root path over and over and followed many of the suggestions here but I just can't get it to work.

    I have renamed catalog to shop. currency_update.php is in my shop file. It calls correctly and I do get the blank page if I run it in a browser. Any ideas?

    Thank you!

  8. #238
    Join Date
    Jun 2010
    Location
    Holland, MI
    Posts
    230
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Everything seemed to run smoothly. I got the following email. Does that mean it worked ok, or???:

    Content-type: text/html
    Steve Pembleton
    www.cheapjumprings.com

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

    Default Re: Currency Update (Automatic)

    Hi Steve,

    The email shows that it runs smoothly!

    I checked one of your items selling for $47.74 which converts to €35.27.

    If the value in your Configuration > My Store > Currency Conversion Ratio has been left to the default 1.05 (to allow for bank commissions), then the conversion is perfect:

    Today's EUR/USD rate is 1.4212. Therefore $47.74 / 1.4212 = 33.59 x 1.05 = €35.27 = correct.

    This mod is something you set up once and then forget about it; it works by itself. Just check the email from time to time for any possible errors reported. If you get the "Content-type: text/html", there's nothing else you need to do.

    Well done!

  10. #240
    Join Date
    Jun 2010
    Location
    Holland, MI
    Posts
    230
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Thanks. I love the add-on. I keep forgetting to update the currencies, but luckily have so few foreign customers that it has not been an issue.

    Thanks for the add-on and for your confirmation
    Steve Pembleton
    www.cheapjumprings.com

 

 
Page 24 of 30 FirstFirst ... 142223242526 ... LastLast

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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR