Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

add to cart / buy now with SSL - Solved ?


eaglik

Recommended Posts

Recently been having problems with shopping cart and the buy now  / add to cart buttons after forcing my site to HTTPS.

Prior to that all worked fine but after forcing the site to HTTPS I had problems with Buy Now and Add to Cart buttons. (My hosting provider had an option to force entire site to HTTPS which I used, so whether your type in http or https you go to the https version )

Buy Now would work from the catergory pages but the Add to Cart Button on the product detail page would go through the motions but not actually add anyting to the shopping carts

Made the changes in the config files but still the same answer.

This is what I changed it to originally  ( also tried entering data in the cookie path fields but still no joy )

<?php
  define('HTTP_SERVER', 'http://www.hgvremaps.co.uk');
  define('HTTPS_SERVER', 'https://www.hgvremaps.co.uk');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', 'hgvremaps.co.uk');
  define('HTTPS_COOKIE_DOMAIN', 'hgvremaps.co.uk');
  define('HTTP_COOKIE_PATH', '/');
  define('HTTPS_COOKIE_PATH', '/');
  define('DIR_WS_HTTP_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');

 

But I could not get it to work properly. 

Everything I read suggest there was a problem with passing data between cookie domains.

I tired all kinds of suggestions I found on these forums and others but still no joy.

 

In the end I changed it to this

<?php
  define('HTTP_SERVER', 'https://www.hgvremaps.co.uk');
  define('HTTPS_SERVER', 'https://www.hgvremaps.co.uk');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', 'hgvremaps.co.uk');
  define('HTTPS_COOKIE_DOMAIN', 'hgvremaps.co.uk');
  define('HTTP_COOKIE_PATH', '/');
  define('HTTPS_COOKIE_PATH', '/');
  define('DIR_WS_HTTP_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');

Note the HTTP server is now shown as HTTPS on the first line

This worked a treat for me and the shopping cart and buy and add buttons work fine

Whether this is simply a function of how my own hosting provider forces the https connections or whether this will help others with similar problems I am not sure. 

If all else fails give it a try, it might work for you.

Thanks

Kevin Eagling

KEE Automotive Ltd

Link to comment
Share on other sites

Also change:

define('HTTP_COOKIE_DOMAIN', 'hgvremaps.co.uk');
define('HTTPS_COOKIE_DOMAIN', 'hgvremaps.co.uk');

To:

define('HTTP_COOKIE_DOMAIN', '.hgvremaps.co.uk');
define('HTTPS_COOKIE_DOMAIN', '.hgvremaps.co.uk');

 

Link to comment
Share on other sites

Not sure what those extra “ . “  do but I have not included them and it seems to work without. 

 

Maybe as they were missing they caused some of the problems I had ?

Thanks

Kevin Eagling

KEE Automotive Ltd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...