Jump to content

Archived

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

canman

Shopping cart empty when checkout is clicked

Recommended Posts

Hi People!

 

I am having a wierd problem that did not exist, pre-MS2. I installed a new site, with MS2. I can add things to my cart, etc. When I click checkout, it says that my shopping cart is empty! I can then click the continue button to see that in fact my items are still in the cart.

 

It seems rather strange that something like this is happening. I have not changed any of the code... this is a stock installation so far.

 

Any assistance would be appreciated. Hopefully it is something small, funny, and silly.

 

Thanks!

Share this post


Link to post
Share on other sites

I have developed the same problem on a MS2.2 install after installing the Purchase No Account contribution. I've dug through code looking for the answer, but so far no dice.

Share this post


Link to post
Share on other sites

Well... I don't know if this will help... but I realized that the shopping cart was considered empty as soon as the site jumped to the SSL pages... as if the cookie (or whatever it is that persists the cart data) was not being passed properly.

 

I didn't bother to fix it yet... all I did was turn off SSL... and the problem is gone.

 

Not really a solution unless you don't use SSL.

Share this post


Link to post
Share on other sites

Just set ENABLE_SSL to false in includes/configure.php.

 

Keep in mind this means that your https:// server will no longer be used.

Share this post


Link to post
Share on other sites

I'm having the same problem

 

- Click on 'continue to cart' and the cart is empty

- If I click 'continue' again, I'm logged out of the shop, and the product is displayed in the cart!

- When I log back in, and place another order, the same thing happens, but accumulates products in the (logged out) shopping cart

 

anyone help?

 

PaulG

Share this post


Link to post
Share on other sites

I did some testing on it, and found out the following (note that this occurs on my store, perhaps not yours):

 

- If a customer places an order that is successful, then returns to the site to place either a supplementary order, or a completely new order of a different product, The shopping cart shows up zero.

 

Which would basically allow peolpe to place one, and only one order, on my site!

 

arrgh!

 

Hopefully someone can shed light on this.

PG

Share this post


Link to post
Share on other sites

Well, the problem with the cookies not being transferred to SSL has to do with using your host's shared SSL key. Cookies cannot transfer domains, so you loose your shopping cart when moving to secure. One solution is to buy your own SSL certificate for your domain. Another is to disable cookies, which of course leads to the osCsid=blahblahblah returning. Luckily, it only appears after you place something in the cart, so probably search engines won't pull these up on all your pages when crawling. However, this itself (as other people on the forums have stated) leads to security issues with people jacking sessions via the session ID and adding things to other peoples carts, if you want to consider that a problem.

 

These same questions are on many many many threads, with people purposing lots of solutions, but I have yet to see anyone say "Eureka! I've got it!" and explain how to make everything nice. I mean, I was under the impression that osCommerce worked really well with shared SSL certificates. It's a large part of why I initially decided to use it. :(

Share this post


Link to post
Share on other sites
I mean, I was under the impression that osCommerce worked really well with shared SSL certificates. It's a large part of why I initially decided to use it.

 

I use 2.2 MS2 under a shared cert and so far its working great! But my http: and https: are identical URL's except for the protocol type.

 

I also installed a Verisign cert after wasting much time with other brands - couldnt get *anything* to work under a chained certificate. Of course I could always sign my own cert - but then microsoft browsers sometimes say "page cannot be displayed" yadahyadahyadah. guess i wondered off the subject here.

 

osc is the best ever cart!


Overheard at a coffee shop:

"As a Plants Rights activist I prefer orchids to mammals. Trust No One who lacks a cell wall."

Share this post


Link to post
Share on other sites

Found a solution that worked for me, might not apply to your situation, however. I had the same error (cart becomes empty when user goes from an unsecure (http:// ) page to a secure one (https:// )

 

In my catalog/includes/configure.php file:

 

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

 

I had extra slashes ( / ) after the web address for both the HTTP_SERVER and HTTPS_SERVER like so:

 

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

 

This caused the page to load as: https://www.thekarmaforest.com//catalog/.. etc

 

removing this slash kept the contents of the cart intact!

 

Don't as me why though =)

Share this post


Link to post
Share on other sites

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 :(


-Eric Schrader

Share this post


Link to post
Share on other sites

catalog/includes/configure.php:

  define('HTTP_SERVER', 'https://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', '');
 define('HTTPS_COOKIE_DOMAIN', '');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');

 

FIXED IT!!!

 

admin/includes/configure.php:

 define('HTTP_SERVER', 'https://toneworkmediamusic.c4.ixwebhosting.com'); // eg, http://localhost or - https://localhost should not be NULL for productive servers
 define('HTTP_CATALOG_SERVER', 'https://toneworkmediamusic.c4.ixwebhosting.com');
 define('HTTPS_CATALOG_SERVER', 'https://toneworkmediamusic.c4.ixwebhosting.com');
 define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module

 

My hosting company changed the cookie domain to '' and now it works!!!! TRY IT!

Here's what they said my problem was:

In order to use shared ssl, your oscommerce site should be running at

 

 

http://toneworkmediamusic.c4.ixwebhosting.com and the oscommerce site has to be accessed at

 

http://toneworkmediamusic.c4.ixwebhosting.com only when using shared ssl, that's why please be sure to make following changes in toneworkmedia.com/catalog/includes/configure.php :

define('HTTP_SERVER', ''); to define('HTTP_SERVER', '

 

http://toneworkmediamusic.c4.ixwebhosting.com');

define('HTTPS_SERVER', ''); to define('HTTPS_SERVER', '

 

https://toneworkmediamusic.c4.ixwebhosting.com');

define('ENABLE_SSL', false); to define('ENABLE_SSL', true);


-Eric Schrader

Share this post


Link to post
Share on other sites

I am having the exact same issues you where having, can you post your before and after configure.phps? I am having trouble understanding your directions, I don't know maybe I'm tired.

Share this post


Link to post
Share on other sites

I had the EXACT same problem and had to put my client on hold for awhile before someone came up with a soluton. decursus you rock!

Share this post


Link to post
Share on other sites
Ok I got it TOO!!!! IT IS A config.php mis configuration...I tried to explain it all here

http://forums.oscommerce.com/index.php?showtopic=257116

 

the thing you suggested isnt a good solution, the only thing you do is rederecting everything to SSL....

Im having the problem too, trying to solve it the whole day. Just cant seem to find a solution.

 

it just goes back to a other session when switching to HTTPS and switching back to HTTP.....

 

the sessions or cookies or whatever, dont exactly know how it technicaly work but anyways, that should be in a map accessed from both configure files in to the same directory. But i dont know how to configure that...

 

just my 2 cents... cheers

Share this post


Link to post
Share on other sites
the thing you suggested isnt a good solution, the only thing you do is rederecting everything to SSL....

Im having the problem too, trying to solve it the whole day. Just cant seem to find a solution.

 

it just goes back to a other session when switching to HTTPS and switching back to HTTP.....

 

the sessions or cookies or whatever, dont exactly know how it technicaly work but anyways, that should be in a map accessed from both configure files in to the same directory. But i dont know how to configure that...

 

just my 2 cents... cheers

 

I too have this problem although without even going to HTTPS. I click on an item and there is nothing there, not even when I click on continue???

 

Trev

Share this post


Link to post
Share on other sites

Hi..

I have exactly the same problem as trevb54. I click on a ADD TO CART button and then it redirects me to my shopping cart, telling me "Your shopping cart is empty !". I don`t run on a HTTPS server, all my orders are running on HTTP, so, from what i`ve read, it can't be from the configure.php.

 

I need urgent help !!

PLEASE HELP ME

Thanks in advance

Share this post


Link to post
Share on other sites

To fix the empty shopping cart problem, do the following:

 

Set "Force Cookie Use" to FALSE

 

To do this, go to your Admin control panel > Configuration > My Store > Sessions

 

I finished three Sites and all of them run great with this setting.

 

Please let me know if your problem was solved!

Share this post


Link to post
Share on other sites
To fix the empty shopping cart problem, do the following:

 

Set "Force Cookie Use" to FALSE

 

To do this, go to your Admin control panel > Configuration > My Store > Sessions

 

I finished three Sites and all of them run great with this setting.

 

Please let me know if your problem was solved!

 

 

Worked for me, thanks!!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Check to see if you have enabled the url function.

 

 

Shop admin > Configuration > My store > Use Search-Engine Safe URLs (still in development) > false

 

Maybe thats why it says "still in development". Not quite sure why it is included at all.

 

Hope this helps...

Share this post


Link to post
Share on other sites
Check to see if you have enabled the Search Engine Safe url function. If so, try this setting:

 

Shop admin > Configuration > My store > Use Search-Engine Safe URLs (still in development) > false

 

 

Maybe thats why it says "still in development". Not quite sure why it is included at all.

 

Hope this helps...

Share this post


Link to post
Share on other sites

×