Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: HTML error, don't know how to resolve.

    Hi Scetchy,

    Yep, will have a glass of bubbly, to celebrate.
    Nah, no negative stress, just a few chalenges to overcome.
    I had a web developer to design a cart for me (windows based), but he got stuck, so I was left to fix everything on my own, (reset the server to Linux - learn a bit of PHP, cURL, CSS) with only a little experience in HTML/JavaScript etc.

    Now I have my cart running and have received some orders as well. Also had to rewrite a curl script to make it work with my payment gateway.

    The only thing that still needs to be ironed out is the automatic update of the currencies, as that seems to be a scripting error as well. (My host tells me that they have no restrictions on PHP or port 80 calls - though port 80 is used for their webmail).

    I also need to give some more attention to my Dutch language option, and have to edit my product display, as my better half (Ineke) decided to change the width of the cart midway through the development, and then decided to change it back again - so now I have some graphics running past the width)

    Thanks to all you helpfull guys/galls here in ZenCart Forum.

    I am slowly becomming totally Zenned LOL

    Goshawk

  2. #12
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: HTML error, don't know how to resolve.

    cURL Proxy support was added to v1.3.5, modeled after the Linkpoint and authorize.net-aim payment module implementations.

    v1.3.5 also added the ability for cURL to be an automatic fallback for currency-updates since many hosts block file() for fsockopen() calls to external hosts. Uses same site-wide proxy settings, as configured in Admin->My Store
    .

    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.

  3. #13
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: HTML error, don't know how to resolve.

    Dr Byte,

    Thank you for your reply, my settings in admin\configuration\my store are (GoDaddy)

    cURL Proxy Status True
    cURL Proxy Address 64.202.165.130:3128

    But this does not seem to have an impact on the automatic currency update.

    I had a similar problem with my payment gateway (DirectOne -Australia), and had to change some of the cURL code to make it work.

    In my payment gateway I added:

    curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
    curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    curl_setopt ($ch, CURLOPT_PROXY,"http://64.202.165.130:3128");
    after the $ch = curl_init();

    Should I add the same code to the currencies? If so what module and where, as I looked through the currencies.php in catalogue\admin but I cannot see a curl_init(); call inside the code.

    Many thanks,

    Goshawk

  4. #14
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: HTML error, don't know how to resolve.

    This is what the currency-updater uses (as of v1.3.5), similar to authorize.net and linkpoint payment modules of late, effectively automating the code you were adding manually:
    Code:
        if (CURL_PROXY_REQUIRED == 'True') {
          curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, true);
          curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
          curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS);
        }
    The first and last constants mentioned there correspond to the 2 keys set in the Admin configuration menu.


    The currency-updater is in /admin/includes/functions/localization.php
    .

    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.

  5. #15
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: HTML error, don't know how to resolve.

    Hi DrByte,

    I have just tried the following:

    Code:
    function doCurlCurrencyRequest($method, $url, $vars) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
        curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
        curl_setopt($ch, CURLOPT_PROXY,"http://64.202.165.130:3128");
        curl_setopt($ch, CURLOPT_URL,$url);
        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, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    //  curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
    //  curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
        if (strtoupper($method) == 'POST') {
          curl_setopt($ch, CURLOPT_POST, true);
          curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
        }
    //    if (CURL_PROXY_REQUIRED == 'True') {
    //      curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, true);
    //      curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    //      curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS);
    //    }
    I tried this to see if it would make a difference in my response, but the response is still the same:

    Warning: The primary exchange rate server (oanda) failed for US Dollar (USD) - trying the secondary exchange rate server.
    Error: The exchange rate for US Dollar (USD) was not updated via xe. Is it a valid currency code?
    Is there anything (short from a manual update) that I can try?

    Goshawk

  6. #16
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: HTML error, don't know how to resolve.

    Some have said that this may no longer work on GoDaddy?

    Code:
     curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
    .

    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.

  7. #17
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: HTML error, don't know how to resolve.

    I have the same in my payment module, and this is working fine on those settings.

  8. #18
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: HTML error, don't know how to resolve.

    I can't help you without having direct access to your files.

    Why not start by adding some debug code into all those functions, and see what's executing where and why, etc.

    ie: Do you know whether the cURL functions are even being called? It starts with file() requests to the currency servers, and then falls back to cURL if that fails. Perhaps it's not failing to contact, but somehow it's not reading information right.

    That said, feel free to rewrite the code however you like. I was merely recommending following built-in methods in order to minimize compatibility problems with upgrades.
    .

    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.

  9. #19
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: HTML error, don't know how to resolve.

    Thank you DrByte,

    I shall have a play with the code, and see if that resolves anything.
    Hopefully I will get this to work.

    Goshawk

  10. #20
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: HTML error, don't know how to resolve.

    Hi DrByte,

    This is the error message I get:

    http://www.oanda.com/convert/fxdaily...ihttp......etc....
    Warning: Cannot modify header information - headers already sent by (output started at /home/............./shop/............./localization.php:68) in /home/........../shop/................/functions/general.php on line 34
    from this code:

    Code:
      function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) {
        $url = 'http://www.oanda.com/convert/fxdaily';
        $data = 'value=1&redirected=1&exch=' . $code .  '&format=CSV&dest=Get+Table&sel_list=' . $base;
        $page = doCurlCurrencyRequest('POST', $url, $data) ;
        $page = explode("\n", $page);
        }
        if (is_object($page) || $page !='') {
          $match = array();
    
          if (sizeof($match) > 0) {
            return $match[3];
          } else {
            return false;
          }
        }
    
      function quote_xe_currency($to, $from = DEFAULT_CURRENCY) {
        $url = 'http://www.xe.net/ucc/convert.cgi';
        $data = 'Amount=1&From=' . $from . '&To=' . $to;
        $page = doCurlCurrencyRequest('POST', $url, $data) ;
        $page = explode("\n", $page);
        }
        if (is_object($page) || $page !='') {
          $match = array();
    
          preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match);
          if (sizeof($match) > 0) {
            return $match[1];
          } else {
            return false;
          }
        }
        
    function doCurlCurrencyRequest($method, $url, $vars) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_VERBOSE, 1);
        curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
        curl_setopt($ch, CURLOPT_PROXY,"http://64.202.165.130:3128");
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    //  curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
    //  curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
    echo $url;
    echo $data;
       $data = curl_exec($ch);
       $error = curl_error($ch);
       curl_close($ch);
       if ($data != '') {
         return $data;
       } else {
         return $error; 
       }
    
    }
    ?>
    I am not a programmer, so I hope I took only the relevant code from the original file, and made the required changes to the cURL.

    If you would be so kind to help me, I will give you the required access to FTP and admin by private message.

    Kind regards and many thanks,

    Goshawk

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. ERROR, Don't know what to search for!
    By Bikerstuff in forum General Questions
    Replies: 14
    Last Post: 24 Jun 2014, 06:49 PM
  2. I keep getting an error, I don't know why
    By andybr1ggs in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 28 Jul 2009, 07:23 PM
  3. Internal error caused by USPS Shipping Module, How to resolve it?
    By transtor in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 19 Mar 2009, 01:01 AM
  4. I Broke Admin, But Don't Know How
    By bobguindon in forum Basic Configuration
    Replies: 2
    Last Post: 2 Apr 2007, 01:15 PM
  5. Don't know how to use gateways.....
    By lina0962 in forum General Questions
    Replies: 1
    Last Post: 13 Jun 2006, 03:44 PM

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