Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping cart empty when checkout is clicked


canman

Recommended Posts

Im having the same issue and i set force cookies to false. It's not the shopping cart being empty it's the checkout being empty. I add items to my shopping cart and then click checkout. I login with my username and it says, "your shopping cart is empty" then i go back to my mainpage and it shows items in my shopping cart. Any help would be great.

 

 

I am having the exact same problem.

 

When I first visit the site, I am a guest, I chose what I want to buy, and hit CHECKOUT

 

So then I am asked to log in, so I do, and my cart then appears to be empty.

 

I have tried EVERY setting and trick that has been mentioned in this thread. With no avail.

 

The ONLY way I can do one solid smooth purchase, is if I clear ALL my cookies, and start fresh. At that point, even after logging in for CHECKOUT, my item remains in the cart, and I can finish the purchase.

 

BUT, if I return one day, search the site, pick a product, when I hit CHECKOUT and it asks me to sign in, the item I JUST chose is gone from my cart, and the item I chose yesterday is in the cart now.

Link to comment
Share on other sites

  • 2 weeks later...

I've been trying to do a server upgrade and have experienced the same problem. All my sites work correctly on my old server but when I migrate them to my new server the shopping cart gets emptied when I click checkout or go to login.

 

Here are some things I have done.

 

When sessions are stored in mysql, the sessions are entered into the database. I've dropped the sessions table and verified that the session data is created. I changed to file based and I can see the file for the session being created.

 

I did a clean install of oscommerce rc1. It works fine with cookies. Works fine with ssl no cookies. Breaks when you have shared ssl.

 

My old server has:

 

Mandriva 2006

PHP 5.0.4

Apache 2.0.54

MySQL 4.1.12

 

New server has:

 

Mandriva 2007.1

PHP 5.2.1

Apache 2.2.4

MySql 5.0.37

 

I suspect it has something to do with a change in how php treats session information but I'm not sure. I'm going through the php change logs for any information that can help me tract down the problem.

 

I don't have the solution to this proble but maybe this info can be helpful.

Link to comment
Share on other sites

I've been trying to do a server upgrade and have experienced the same problem. All my sites work correctly on my old server but when I migrate them to my new server the shopping cart gets emptied when I click checkout or go to login.

 

Here are some things I have done.

 

When sessions are stored in mysql, the sessions are entered into the database. I've dropped the sessions table and verified that the session data is created. I changed to file based and I can see the file for the session being created.

 

I did a clean install of oscommerce rc1. It works fine with cookies. Works fine with ssl no cookies. Breaks when you have shared ssl.

 

My old server has:

 

Mandriva 2006

PHP 5.0.4

Apache 2.0.54

MySQL 4.1.12

 

New server has:

 

Mandriva 2007.1

PHP 5.2.1

Apache 2.2.4

MySql 5.0.37

 

I suspect it has something to do with a change in how php treats session information but I'm not sure. I'm going through the php change logs for any information that can help me tract down the problem.

 

I don't have the solution to this proble but maybe this info can be helpful.

 

 

I found the cause and solution to my problem. I hope it can help others.

 

The cause of the problem:

 

Suhosin from the hardened php project. Suhosin is an advanced protection system for PHP installations. This was installed by default for my distro.

 

Solution:

 

In the configuration file for suhosin, set suhosin.session.cryptdocroot = Off.

 

For my installation the location of the configuration file is:

 

/etc/php.d/Z99_suhosin.ini

Link to comment
Share on other sites

I thought I'd register my problems as well in hopes that there is a solution. My problem is the same as Frozen. All is fine when adding items to cart. It's when I click "check out" that the cart empties and the message says "Your Shopping Cart is empty!"

 

I too just recently got a shared SSL.

Link to comment
Share on other sites

OK. Now it looks like I've gotten past the whole "Shopping Cart is empty!" message. However, when the system moves me forward through check out, input credit card numbers, etc., at the very end when I click the "Confirm" button I'm taken to my login. The order appears to not complete because it doesn't take me to the confirmation page or "Finished" page. I don't see the order in my history either.

 

Please help.

Link to comment
Share on other sites

More on my problems...

After trying all sorts of combinations with my configure.php file I've narrowed down the the problem to a strange behavior. I'm now noticing that when I click the "check out" button after I've added several unique items to the cart and inputted my credit card information, I'm taken to the "Order Confirmation" page. However, the items on that page are not the ones I ordered. So I click anyway to see what happens. What happens is that I'm not taken to the "Finished" page, the order doesn't appear in history but what's strange is that I see the charge hit my merchant account.

 

Could anyone help me please. Here's the code I have on my configure.php

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', 'http://www.apologetics.com/'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', 'https://secure.inetwave.com/apologetics'); // eg, https://localhost - should not be empty for productive servers

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

define('HTTP_COOKIE_DOMAIN', 'www.apologetics.com');

define('HTTPS_COOKIE_DOMAIN', 'secure.inetwave.com/apologetics');

define('HTTP_COOKIE_PATH', '/catalog/');

define('HTTPS_COOKIE_PATH', '/catalog/');

define('DIR_WS_HTTP_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

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/');

Link to comment
Share on other sites

After more than 48 hours, I finally gave up. I reverted back to an unsecure check out.

 

Now my problem is that I'm unable to access my admin. Don't really know why any of this affected it. Now I need help in that area because it doesn't make sense to have a store when I can't access my admin.

 

-Harry

Link to comment
Share on other sites

After more than 48 hours, I finally gave up. I reverted back to an unsecure check out.

 

Now my problem is that I'm unable to access my admin. Don't really know why any of this affected it. Now I need help in that area because it doesn't make sense to have a store when I can't access my admin.

 

-Harry

 

 

The solution is simple

 

1. make sure your website is a dedicated IP

2. purchase your own SSL certificate, not using the one provided by your host

3. make sure the SSL is installed

4. change

 

 define('HTTP_SERVER', 'http://www.apologetics.com/'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://secure.inetwave.com/apologetics'); // eg, https://localhost - should not be empty for productive servers

 

to

 

 define('HTTP_SERVER', 'http://www.apologetics.com/'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://www.apologetics.com'); // eg, https://localhost - should not be empty for productive servers

 

That's what did it for me, and now i no longer have this problem

Link to comment
Share on other sites

The solution is simple

 

1. make sure your website is a dedicated IP

2. purchase your own SSL certificate, not using the one provided by your host

3. make sure the SSL is installed

4. change

 

 define('HTTP_SERVER', 'http://www.apologetics.com/'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://secure.inetwave.com/apologetics'); // eg, https://localhost - should not be empty for productive servers

 

to

 

 define('HTTP_SERVER', 'http://www.apologetics.com/'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://www.apologetics.com'); // eg, https://localhost - should not be empty for productive servers

 

That's what did it for me, and now i no longer have this problem

 

It seems there are a myriad of reasons why this may happen...and I have tried every solution in the book with no success. When I click Add to Cart on any product at all, it takes me to the shopping cart with a message "Shopping Cart is Empty!" My site was working fine until I made a small change to the admin/includes/configure.php file to correct an issue with Module Options not showing...now I can't use the shopping cart!!

 

Made all sorts of 'fixes' to the configure.php file (one at a time, and all at once) - no luck

Register Globals is Off

SEF is Off

Have a dedicated IP and SSL

Defined cookie path, left it blank - neither worked

Tried to totally reinstall clean configure.php file and start from scratch - nope, that didnt work either

 

Please please, someone help figure this out! I have a deadline of 6 days to get this project live and I was right on track until this afternoon! Nothing I do is working!!

Link to comment
Share on other sites

I'm going to spend a few moments to explain how to use ONE SSL certificate among multiple sites.

 

It's possible you won't be able to do this because it requires access to at least one of the configuration files for the Apache server.

 

The system I am using, I just built

 

It is using SuSe Enterprise server running SLES 10.1 - this would be basically the same as SuSeOpen 10.1 with this distro you get

 

Apache 2.2.3

PHP 5.12

mySQL

 

Suhosin 0.9.6

 

 

The version of os commerce I'm running is old, the reason I'm still using it is... I've highly modified the pages so they work in a winery based environment. I've also modded up the shipping module so it handles the issue of "reciprocal states" (a condition where 27 states in the US allow each other to ship wine to directly, with different legal maximums within pre-defined time periods).

 

The version of oscommerce I'm using is 1.2 and it was developed around when PHP4.04 was released.

 

I have fewer "oscommerce config tools" to help me with this.

 

Here is the recipe:

 

In the past I've used a symbolic link in the main servers directory

 

The doc root the MAIN SSL site was say... /web_work/sites/1webicom/http

 

The doc root for the subordinate site was /web_work/sites/8pkv/http

 

I would create a symlink from the the MAIN to the Subordinate site

 

an ls -l would look like this

 

lrwxrwxrwx 1 wwwrun www 19 Nov 11 17:40 pkv -> /web_work/8pkv/http

 

The configuration file would like this

 

define('HTTP_SERVER', 'http://www.pkv.com'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', 'https://www.webicommerce.com/pkv'); // eg, https://localhost - should not be empty for productive servers

 

Everything that would occur in the HTTPS side of the transaction worked as though the directory "pkv" was nested inside the SSL doc

root.

 

This worked fine

***

 

Fast forward to the new install....

 

Apache doesn't allow symlinks to be used this way anymore. In fact it prohibits the following of a symlink. What it does instead... is use

"Aliases" which are hard coded symlinks.

 

Aliases are defined in the default-server.conf file. In my case the file is located at

 

 

/etc/apache2/default-server.conf

 

Open the file and edit under this part:

 

 

# We include the /icons/ alias for FancyIndexed directory listings. If you

# do not use FancyIndexing, you may comment this out.

#

Alias /icons/ "/usr/share/apache2/icons/"

 

<Directory "/usr/share/apache2/icons">

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>

 

##

 

To it add your Alias, mine would like like this:

 

#

Alias /pkv/ "/web_work/sites/8pkv/http/"

 

<Directory "/web_work/sites/8pkv/http">

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>

#

 

It knows the Alias is to be located *in* the root directory and each time it sees a call to "pkv" in the main http directory it *peers

into* the aliased path directory (/web_work/sites/8pkv/http) instead.

 

Since the URL request will look like "https://www.1webicom/pkv/checkout_payment.php" it serves up an SSL version of the site page

"https://www.pkv.com/checkout_payment.php".

 

It will present the parent site's certificate, but we're all used to this.

 

 

 

The next problem is maintaing the "cart state". This is really best done using sessions rather than cookies in this case, because

cookies placed are intended to be read only by the site palcing them. Oscommerce has a mechanism to get around this but it's

effectiveness depends on the vesion of oscommerce you are using. We will need to convey the cart and the cart state between the non-secude www.pkv.com and the secure www.1webicom.com/pkv site. I would have to say, "Man up, and use sessions".

 

To do this THERE IS A SECOND Objective you will need to overcome. Most distros are coming with the Japanese hardening shell called "Suhosin".

 

You will also need to locate the suhosin.ini file. In my case it's at :

 

/etc/php5/conf.d/suhosin.ini

 

Look down it and find this area:

 

;suhosin.session.cryptkey =

;suhosin.session.cryptua = 1

;suhosin.session.cryptdocroot = 1

;suhosin.session.cryptraddr = 0

;suhosin.session.checkraddr = 0

 

 

 

 

Change it to:

 

 

;suhosin.session.cryptkey =

;suhosin.session.cryptua = 1

suhosin.session.cryptdocroot = Off

;suhosin.session.cryptraddr = 0

;suhosin.session.checkraddr = 0

 

 

Save all changes and then restart the Apache server... in my case:

 

 

# /etc/init.d/apache2 restart

 

Check SSL side then it's time for a glass of wine.

 

 

Have you heard about Frank Wines? http://www.vipvr.com/frank_wines.shtml

Link to comment
Share on other sites

  • 1 year later...
That didn't work... Is my cookie path right?

	define('HTTP_SERVER', 'http://toneworkmediamusic.c4.ixwebhosting.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', 'https://toneworkmediamusic.c4.ixwebhosting.com'); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'toneworkmediamusic.c4.ixwebhosting.com');
 define('HTTPS_COOKIE_DOMAIN', 'toneworkmediamusic.c4.ixwebhosting.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');

Nothing stays in my cart :(

 

Change the:

define('HTTPS_COOKIE_DOMAIN', 'toneworkmediamusic.c4.ixwebhosting.com');

 

to

define('HTTPS_COOKIE_DOMAIN', 'https://toneworkmediamusic.c4.ixwebhosting.com');

 

i.e. the same as your server https domain, seems to work ok then.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
Thank to everyone here.

 

Nothing helped me, I am sorry to say.

What I finally did was to upgrade to PHP 5 and now everything works.

 

Hope this helps for you.

 

 

Hi all, just a quick note to say that I have also spent a few hours looking through various threads on this problem as I was also having the problem of products disappearing in checkout and most of the suggestions caused more problems than answers.

 

However, I had a previous website using Osc which worked fine although someone else helped set it up for me. It then dawned on me to check the configure.php file from my old site against this new one and to see if there were any major differences. I found a difference. The first part of my old site said:

 

  define('HTTP_SERVER', 'http://jati-keswick.co.uk'); 
 define('HTTPS_SERVER', 'https://web40.secure-secure.co.uk/jati-keswick.co.uk'); 
 define('ENABLE_SSL', true); 
 define('HTTP_COOKIE_DOMAIN', 'jati-keswick.co.uk');
 define('HTTPS_COOKIE_DOMAIN', 'https://web40.secure-secure.co.uk/jati-keswick.co.uk');

 

My new site said:

 

  define('HTTP_SERVER', 'http://classgifts.co.uk');
 define('HTTPS_SERVER', 'https://web245.secure-secure.co.uk/classgifts.co.uk');
 define('ENABLE_SSL', 'true');
 define('HTTP_COOKIE_DOMAIN', 'classgifts.co.uk');
 define('HTTPS_COOKIE_DOMAIN', 'classgifts.co.uk');

 

So I realised that the HTTPS_SERVER and HTTPS_COOKIE_DOMAIN had the same address on the old site but were different on my new site. So I changed:

 

define('HTTPS_COOKIE_DOMAIN', 'classgifts.co.uk');

 

to

define('HTTPS_COOKIE_DOMAIN', 'https://web245.secure-secure.co.uk/classgifts.co.uk');

 

I can now say that my products stay in the cart when I log-in and I have gone all the way through to complete checkout. I would suggest that you also look in your configure.php file in catalogue/includes/configure.php and change your address so that both HTTPS lines are the same. Remember to backup the file first incase of errors.

 

Hope this works for you like it has for me.

 

Michael

Link to comment
Share on other sites

  • 10 months later...

I am having the same problem but my server is "localhost." I have tried all the given solutions in this post but nothing helps. Please, help me!

 

I have set up a demo site on my local machine.

Link to comment
Share on other sites

I am having the same problem but my server is "localhost." I have tried all the given solutions in this post but nothing helps. Please, help me!

 

I have set up a demo site on my local machine.

 

 

:(

 

After waiting for 5 hours for a reply I had to downgrade to older Apache Server version. So that I can solve my problem.

 

This is not fair.

Link to comment
Share on other sites

  • 2 months later...

Just another help: localhost or SSL

I'm using localhost with winXP, problem is same "Shopping cart empty" and I am trial and error.

 

Problem start when i am try to play with cookies (hmm some SEO add-ons), change setting in admin. Restore it to start conditions but still not help.

 

Finally I try to open configure.php in c:/apache/htdocs/.../shop/includes/configure.php

Change setting from

define('HTTP_COOKIE_DOMAIN', 'localhost');

define('HTTPS_COOKIE_DOMAIN', 'localhost');

 

to this one

define('HTTP_COOKIE_DOMAIN', ''); //remove string "localhost"

define('HTTPS_COOKIE_DOMAIN', '');

 

And it works. Hope this help. Semoga membantu.

 

www.hostnesia.com

Link to comment
Share on other sites

  • 1 month later...

A long way back in this thread, decursus gave me the idea to get this fixed.

 

My problem was solved by adding the full URL, inclusive of 'www.' For example.

 

1. This was causing the error "Your Shopping Cart is empty!"

 

define('HTTP_SERVER', 'http://myexamplewebsite.com');

define('HTTPS_SERVER', 'https://myexamplewebsite.com');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', 'myexamplewebsite.com');

define('HTTPS_COOKIE_DOMAIN', 'myexamplewebsite.com');

 

2. This FIXED my error:

 

define('HTTP_SERVER', 'http://www.myexamplewebsite.com');

define('HTTPS_SERVER', 'https://www.myexamplewebsite.com');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', 'myexamplewebsite.com');

define('HTTPS_COOKIE_DOMAIN', 'myexamplewebsite.com');

 

 

Three cheers for decursus.

Link to comment
Share on other sites

  • 1 year later...

Excellent... this sorted out a few problems I was having including:

 

• Empty cart after clicking 'Buy Now'

• Having the session ID showing in address bar and links

• Sorted out secure areas - using the www I could then change the HTTPS_SERVER address to 'https://www.myexamplewebsite.com' whereas before it only worked if I had 'https://myhostingcompanies-shared-ssl/myexamplewebsite.com'

 

Thanks!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...