Zen Cart Logo
Forums / General Questions / SSL private cert for checkout only causing probs

SSL private cert for checkout only causing probs

Locked

Views: 1,223

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
16 Apr 2007, 11:56 AM
#1
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

SSL private cert for checkout only causing probs

So i've altered the config files, set enable for the checkout.
Using private cert.

Go to the login page (still get a few probs with identifying non-secure, but will weed those out later!) and goes to https...great!

Problem is that it changes all the links to other parts/pages of my site to https, i.e all my ez pages, and even the shop link.

How can i stop it doing this?

Other question is, can i turn off the display of the "search" "information"and "categories" from the side boxes during login and check out as these are still kept as http and think they casuing some of the non-secure probs.

Thanks

J

16 Apr 2007, 12:27 PM
#2
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: SSL private cert for checkout only causing probs

Ok, Solved it, thought i'd post my solution.

In my tpl_header.php files under tmeplates, all my links were relative i.e
'<a href="/index.html">'

I had to change these to direct links in order that they didn't change to https when clicking on th login button.

changed to

'<a href="http://www.mydomain.co.uk/index.html">'

Problem solved.

16 Apr 2007, 1:07 PM
#3
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: SSL private cert for checkout only causing probs

better solution, would be to make sure that your configure.php files are setup correctly,

can you paste the top 30 or so lines of the includes/configure.php here

16 Apr 2007, 1:50 PM
#4
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: SSL private cert for checkout only causing probs

// Define the webserver and path parameters
// HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
// HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
define('HTTP_SERVER', 'http://www.northkites.co.uk');
define('HTTPS_SERVER', 'https://www.northkites.co.uk');

// Use secure webserver for checkout procedure?
define('ENABLE_SSL', 'true');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

define('DIR_WS_PHPBB', '/');

16 Apr 2007, 1:51 PM
#5
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: SSL private cert for checkout only causing probs

define('DIR_WS_HTTPS_CATALOG', '/');

Is it the above causing it to happen?

16 Apr 2007, 2:16 PM
#6
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: SSL private cert for checkout only causing probs

no that all looks correct,
thats weird,
but you should never have to change the header files at all

2 May 2007, 9:22 PM
#7
ctopher avatar

ctopher

New Zenner

Join Date:
Nov 2006
Posts:
24
Plugin Contributions:
0

Re: SSL private cert for checkout only causing probs

I'm having the same issue. I have a bunch of links in a side-box that go out of Zen Cart, but stay in my site. What I wanted was a way to use relative links, and if the current page was using SSL, turn it off.

I wrote this ugly bit PHP code and put it near the top of my sidebox PHP file:

<?php

  $sslStat = $_SERVER['HTTPS'];
  $currHost = $_SERVER['HTTP_HOST'];
  $currURL = $_SERVER['REQUEST_URI'];
  $stripURL = trim($currURL, "/");
  $currArr = explode("/", $stripURL);

function makeInsecureRef($relRef)
{
  global $sslStat, $currHost, $currArr;
  if ($sslStat == "")
  {
    echo $relRef;
  }
  else
  {
    $numURLEle = count($currArr);
    // we don't care about the last
    // element in the array since
    // its the current file.
    $numURLEle = $numURLEle - 1;
    $subRelRef = $relRef;
    $done = false;
    while(!$done)
    {
      if (strcmp("../", substr($subRelRef, 0, 3)) == 0)
      {
        $subRelRef = substr($subRelRef, 3);
        $numURLEle = $numURLEle - 1; // backing up a directory
      }
      else
      {
        $done = true;
      }
      if ($numURLEle < 0)
      {
        echo "Error! " . $relRef;
        return;
      }
    }
    echo "http://" . $currHost . "/";
    for ($i = 0; $i < $numURLEle; $i++)
    {
      echo $currArr[$i] . "/";
    }
    echo $subRelRef;
  }
}
?>
```The function makeInsecureRef() assembles a complete URL combining the http:// with the current host ([www.mydomain.com](http://www.mydomain.com)) with as much of the current path as is required.

Then to create the links, I call the makeInsecureRef() function this way:

```html
<a href="<? makeInsecureRef("../out_of_zencart.html");?>">
```This seems to work well for me.

My question (Sorry to hijack the thread) is, where can I put this within the override system, so that ALL of my pages have access to this function? (I need to use it on my footer and header as well.)

I hope this code is helpful and thanks in advance for some help!

Chris