Jump to content
Latest News: (loading..)
robburne

SSL can't add to basket

Recommended Posts

Hi Everyone,

Since installing a self-sign SSL certificate on v 2.3.4 of my store I am unable to add items to my cart - I get a message that my cart is empty.

My config as as follows:

define('HTTP_SERVER', 'https://foobar.com');
define('HTTPS_SERVER', 'https://foobar.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'www.foobar.com');
define('HTTPS_COOKIE_DOMAIN', 'www.foobar.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
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', 'pub/');
define('DIR_FS_CATALOG', '/home/foobar.com/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

There are plenty of other posts to be found reporting this issue without any definitive solution. Is this an issue with OS Commerce - seems to be the case?

Share this post


Link to post
Share on other sites

A self-signed cert will display a warning and require your customers to accept it so it shouldn't be used. I haven't tried using one on a live shop for that reason but I doubt it would work the way your configure file is setup. The configure file is saying there is a cert for the domain name, which there isn't. You can try turning off the ssl option. That won't turn off the self-signed cert since that is applied by the server.

Share this post


Link to post
Share on other sites
1 hour ago, robburne said:

Is this an issue with OS Commerce - seems to be the case?

check with your host or in your control panel and see if you have access to "Let’s Encrypt" if you do use its free auto assign ssl, it will last 90 days and then auto renew automaticly.

Works flawlessly with osC , have it running on a number of sites. You will have to delete your self signed ssl first.

https://letsencrypt.org/


 

Share this post


Link to post
Share on other sites

Actually I just checked, I am using a Let#s Encrypt SLL, apologies for the mis-information.

I understand that the self-signed is a bad choice however I don't understand how this would cause the basket to be empty.

So given that my cert is issued by Let's Encrypt and my config is as above, why can't I add items to the cart?

 

Share this post


Link to post
Share on other sites

Self signed would mean you had to set up the cert manualy which you probably did wrong! deleat the manual cert and use the auto sign method and then see what you have. Also make sure your config is correct in shop and admin.

Also would help to check error log and see what if anything is reported.

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

I didn't ever install the self signed, my host offers 3 options, the self-signed, let's encrypt and a paid version. The Let's Encrypt is done automatically with one click.

I forgot to mention and I'm not sure if it is of significance but my shop is on a sub-domain of my main domain. The cert was installed for the subdomain though.

I will check my logs - hadn't thought of that.

Share this post


Link to post
Share on other sites
6 hours ago, robburne said:

Since installing a self-sign SSL certificate on v 2.3.4 of my store I am unable to add items to my cart

😊 we can only advise based on what you say. Still check both configs are pointing to the same places , especially the cookies as that is the main cause of empty baskets.

The error logs should show something.

Re: https on subdomain
  1. Setup your subdomains.
  2. In cpanel go to SSL/TLS.
  3. Install and Manage SSL for your site (HTTPS) > Manage SSL sites.
  4. add the key and certificate you gets from step 2 to all domains and subdomains.

 

Share this post


Link to post
Share on other sites

What should the http_cookie_domain be. If I disable all SSL and use either of he following:

define('HTTP_COOKIE_DOMAIN', '/');

define('HTTP_COOKIE_DOMAIN', '/mydomain.com');

I also get the empty basket problem.

Share this post


Link to post
Share on other sites
1 minute ago, JcMagpie said:

installing in a directory such as www.mywebsite.com\myshop\

is not the same as installing in a subdomian.

my shop is installed in: shop.mydomain. It is entirely distinct from the main domain

Share this post


Link to post
Share on other sites

Apologies - here is my revised config:

define('HTTP_SERVER', 'https://shop.foobar.com');
define('HTTPS_SERVER', 'https://shop.foobar.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'shop.foobar.com');
define('HTTPS_COOKIE_DOMAIN', 'shop.foobar.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
Edited by robburne

Share this post


Link to post
Share on other sites

Ok I am beaten - this isn't worth the effort it really isn't. This thread is heading in the same direction as every other thread on this topic.

This is clearly an issue with OS Commerce - there are plenty of examples of this problem and so one ever gets or posts a solution.

For the record I can't login to admin now - page just refreshes. Go figure!

Share this post


Link to post
Share on other sites

I think I got to work:

define('HTTP_SERVER', 'https://www.shop.foobar.com');
define('HTTPS_SERVER', 'https://www.shop.foobar.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', '.www.shop.foobar.com');
define('HTTPS_COOKIE_DOMAIN', '.www.shop.foobar.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');

I was missing the www which was causing the problems. I also tested this by having my host redirect all www traffic to http:// and that now works with my previous config.

Hopefully this will help someone else who arrives here with the same problem

Share this post


Link to post
Share on other sites
14 hours ago, robburne said:

This is clearly an issue with OS Commerce - there are plenty of examples of this problem and so one ever gets or posts a solution.

So I guess it wasn't an OS Commerce problem?

Dan

Share this post


Link to post
Share on other sites
1 hour ago, Dan Cole said:

So I guess it wasn't an OS Commerce problem?

Dan

It seems not :) Sorry for the rant, but in getting myself mad it helped fix the issue.

Share this post


Link to post
Share on other sites

It was nice that you came back to report on it.   Often people don't do that and as you pointed out, it looks like their plea for help went unanswered.

Dan

Share this post


Link to post
Share on other sites

Very useful information for people, I think this is what everyone needs.  Thank you very much!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×