Checkout SSL - Switching between http and https

Permalink
Hi,

I have installed an SSL certificate for my ecommerce site. I have the dashboard 'Use SSl for checkout' set tohttp://www.mydomain.co.uk.

When a user is first on the site, the address bar reads http, which is great, when they go to the checkout, it changes to https, which is also great, however if a user navigates out of the checkout, the whole site is stuck in https.

Is there a way just to keep https to the checkout?

atlantisdigital
 
Mainio replied on at Permalink Reply
Mainio
Probably the correct way to do this would be to put some logic where the URL is written.

If you're looking for a quick fix, this will probably do the job (in site.php first thing in the beginning of the file):
if(strpos($_SERVER['PATH_INFO'], '/checkout') === 0) {
   define('BASE_URL', 'https://' . $_SERVER['HTTP_HOST']);
} else {
   define('BASE_URL', 'http://' . $_SERVER['HTTP_HOST']);
}



P.S. I also sent this to you by mail.
Mainio replied on at Permalink Reply
Mainio
But now that I think about this issue with more detail, this does not work when your clients click on other links when they are on one of the checkout pages. You'd probably still need to either
a) modify the logic how your URLs are written (override /helpers/navigation.php, method getLinkToCollection())
OR
b) put some redirect logic that would check whether your customers are on SSL-pages and not, redirect them to http if they would be currently requiring the page through https.

Both of these are quite simple to do. b) can be achieved with a custom package and it would probably be more flexible for this need.

Antti
Mike0051 replied on at Permalink Reply
Mike0051
Did you ever find a solution to this problem?
Thanks