Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,526
    Plugin Contributions
    1

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Quote Originally Posted by lat9 View Post
    Just poking around to see what's up, I made a slight change to /YOUR_ADMIN/includes/functions/localization.php's doCurlCurrencyRequest function, adding the line highlighted below and ... I've got currency updates!

    Please note that I'm not sure if this is the "correct" solution, but it's one that got the desired results.
    Code:
    
      function doCurlCurrencyRequest($method, $url, $vars = '') {
        //echo '-----------------<br />';
        //echo 'URL: ' . $url . ' VARS: ' . $vars . '<br />';
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_REFERER, HTTP_CATALOG_SERVER . DIR_WS_CATALOG);
        curl_setopt($ch, CURLOPT_VERBOSE, 0);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    ...
    TNX Cindy,
    That took care of the issue in zc 1.5.4
    Rick
    ChainWeavers (dot) com

  2. #12
    Join Date
    Jun 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Just tried Lat9's fix and it worked as well. Great work and big thank you.

  3. #13
    Join Date
    Jan 2004
    Posts
    64,748
    Blog Entries
    6
    Plugin Contributions
    74

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    FYI: lat9's fix is now built-in to v1.5.6
    .

    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.

  4. #14
    Join Date
    Aug 2010
    Location
    Egypt - USA
    Posts
    86
    Plugin Contributions
    0

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Quote Originally Posted by DrByte View Post
    There are several suggested workarounds:
    a) lat9's suggestion above to specify a referrer.
    b) change your primary currency server to the built-in alternate of BOC (may wanna update to the latest /admin/includes/functions/localization.php from v1.5.6)
    c) add a different currency exchange source using one of the available plugins (I recommend OpenExchangeRates, but you need to sign up for free api access as explained in the plugin.)
    I used solution a) and it work very good for me, But when i change my default currency to some thing else than USD it set the default currency to 1 and miss all other currency.
    Then i try solution C) and it work very good with all.

  5. #15
    Join Date
    Feb 2015
    Location
    USA
    Posts
    66
    Plugin Contributions
    0

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Quote Originally Posted by lat9 View Post
    Just poking around to see what's up, I made a slight change to /YOUR_ADMIN/includes/functions/localization.php's doCurlCurrencyRequest function, adding the line highlighted below and ... I've got currency updates!

    Please note that I'm not sure if this is the "correct" solution, but it's one that got the desired results.
    Code:
    
      function doCurlCurrencyRequest($method, $url, $vars = '') {
        //echo '-----------------<br />';
        //echo 'URL: ' . $url . ' VARS: ' . $vars . '<br />';
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_REFERER, HTTP_CATALOG_SERVER . DIR_WS_CATALOG);
        curl_setopt($ch, CURLOPT_VERBOSE, 0);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    ...
    Worked for me! Thanks so much

    Carol

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. The primary exchange rate server (oanda) failed
    By MeltDown in forum All Other Contributions/Addons
    Replies: 14
    Last Post: 7 May 2017, 04:27 AM
  2. v155 How to use the "Currency Exchange Rate"
    By su35 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 21 Jul 2016, 06:11 PM
  3. Can I set the type of currencies and exchange rate?
    By AbbyTan in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 23 Sep 2015, 01:13 PM
  4. v151 Incorrect exchange rate?
    By DML73 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 4
    Last Post: 30 Apr 2015, 05:11 PM

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