Page 25 of 30 FirstFirst ... 152324252627 ... LastLast
Results 241 to 250 of 298
  1. #241
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Steve, the confirmation was mine but the add-on wasn't developed by me, I'm just a user like you!

  2. #242
    Join Date
    Jun 2010
    Location
    Holland, MI
    Posts
    230
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Then thank you for the confirmation, and thanks to the author for the add-on
    Steve Pembleton
    www.cheapjumprings.com

  3. #243
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Can anyone help out?

    I have installed this mod once and it has worked great. I am setting up a new store with the multistore add on and i now get the error below.

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

    the domain does not exist.
    Any ideas???

  4. #244
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Currency Update (Automatic)

    Have you posted in the wrong thread? Can't see what this has to do with the automatic currency update?
    Kuroi Web Design and Development | Twitter

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

  5. #245
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by kuroi View Post
    Have you posted in the wrong thread? Can't see what this has to do with the automatic currency update?
    No i have installed the automatic currency updater and i am getting an error in the email from the cron job that says

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

    the domain does not exist.
    i have the multisite contribution added to my site and when i remove the pce of code that you have to add to the includes/config file

    include_once('includes/config_sites/sites_switch.php');
    it works fine.
    How do i fix this??

  6. #246
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    i also got this error a couple of times from the cron email but it has quit now!!??!!??

    <br />
    <b>Warning</b>: include_once(includes/config_sites/sites_switch.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in <b>/HOME*/USER_NAME/public_html/includes/configure.php</b> on line <b>2</b><br /> <br />
    <b>Warning</b>: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'includes/config_sites/sites_switch.php' for inclusion (include_path='.:/usr/share/pear') in <b>/HOME*/USER_NAME/public_html/includes/configure.php</b> on line <b>2</b><br />
    Has anyone else got this working as well as multisite??

  7. #247
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Currency Update (Automatic)

    The problems that you're reporting seem to be linked to the code added for multisite rather than the code being executed for this mod.

    It's possible that this is because the multisite code or instructions are using relative rather than absolute paths, so if you run this mod from somewhere other than the root of your site, it can't resolve those paths properly. But that would need to diagnosed and fixed by somebody familiar with multisite.
    Kuroi Web Design and Development | Twitter

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

  8. #248
    Join Date
    Jul 2007
    Posts
    13
    Plugin Contributions
    0

    Idea or Suggestion Re: Currency Update (Automatic)

    Moi,

    Oanda and XE keeps giving me errors, so I have added one more server and updated my code accordingly.

    admin/includes/functions/localization.php
    - added new function
    Code:
      function quote_ecb_currency($code, $base = DEFAULT_CURRENCY) {
    
        $xml= new SimpleXMLElement(file_get_contents("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"));
    
        # extract default currency's exchange rate.
        $nzd = $xml->xpath("//*[@currency='".$base."']");
        $base_rate = (float)$nzd[0]['rate'];
        if ($base == 'EUR') {$base_rate=(float)1;}
        
        # extract requested currency's exchange rate.
        $nzd = $xml->xpath("//*[@currency='".$code."']");
        $rate = (float)$nzd[0]['rate'];
        if ($code == 'EUR') {$rate=(float)1;}
    
        $new_rate = $rate/$base_rate;
    
        if ($new_rate != 0) return $new_rate;
        else return null;
      }
    admin/currencies.php
    - updated the 'update' with completely new code.
    Code:
          case 'update':
            $currency = $db->Execute("select currencies_id, code, title from " . TABLE_CURRENCIES);
            $servers = array('ecb', 'oanda', 'xe');
            zen_set_time_limit(600);
            while (!$currency->EOF) {
              foreach($servers as $server_used){
                $quote_function = 'quote_' . $server_used . '_currency';
                $rate = $quote_function($currency->fields['code']);
                if (!empty($rate)){
                  /* Add currency uplift */
                  if ($rate != 1 && defined('CURRENCY_UPLIFT_RATIO')) {$rate = (string)((float)$rate * (float)CURRENCY_UPLIFT_RATIO);}
                  $db->Execute("update " . TABLE_CURRENCIES . "
                    set value = '" . $rate . "', last_updated = now()
                    where currencies_id = '" . (int)$currency->fields['currencies_id'] . "'");
                  $messageStack->add_session(sprintf(TEXT_INFO_CURRENCY_UPDATED, $currency->fields['title'], $currency->fields['code'], $server_used), 'success');
                  break;
                }
                else $messageStack->add_session(sprintf(WARNING_SERVER_FAILED, $server_used, $currency->fields['title'], $currency->fields['code']), 'warning');
              }
             $currency->MoveNext();
            }
            zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']));
          break;
    admin/includes/languages/english/currencies.php
    - added new definition
    Code:
    define('WARNING_SERVER_FAILED', 'Warning: The exchange rate server (%s) failed for %s (%s)');
    I do not have automatic updates, but now I have European Central Bank (ECB) daily rates as a primary exchange rate server

  9. #249
    Join Date
    Jul 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    BTW. the original zencart code has a bug. If both, the primary(oanda) AND backup(xe) server fails to provide sane rate, the particular currency rate will become corrupt/zero.

  10. #250
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Currency Update (Automatic)

    As has been stated elsewhere, ECB support is built-in to v1.5.0, as well as resolution of the problem that would set values to 0 if the update failed. I can't speak to how any automated-update scripts work, but the core ZC code is fine.
    .

    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.

 

 
Page 25 of 30 FirstFirst ... 152324252627 ... 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