Cart emptying during checkout

Hi, all.



We currently have a problem with customers reporting that their shopping cart has emptied during the process of entering their details into the checkout. The problem appears to happen between the checkout steps, when the ‘Next’ or ‘Save’ button is cleared. As far as we’re aware (we’re unable to recreate it), the cart works normally until that point.



So far, we have confirmed that the problem has occurred with customers on Firefox (version unknown), Chrome (ditto) and IE8…so it’s fairly widespread.



We have implemented the following suggested patches from the forums:



[url]http://forum.cs-cart.com/showthread.php?t=14744&highlight=checkout+empty+cart[/url]

(class.session.php - proxy ip address)



[url]http://forum.cs-cart.com/showthread.php?t=16233&highlight=checkout+empty+cart[/url]

(class.session.php - sub-domain)



[url]http://forum.cs-cart.com/showthread.php?t=14848&highlight=SKIP_SESSION_VALIDATION[/url]

(config.php - SKIP_SESSION_VALIDATION)



…but have had no success with any of them.



We are currently running v2.0.14. It would obviously be idea if we were running the latest version, but the upgrade process has raised so many other problems that we’ve been forced to abandon it for the time being.



We’ve also raised a support ticket, but have been told that it’s not an issue that’s been reported before and advised to use the forums instead. Apparently, other customers have reported issues with firewalls…but nobody at CS-Cart thought it interesting enough to ask them what those issues might’ve been or how they resolved them. Impressive stuff! :rolleyes:



So, has anyone here experienced anything similar? Or have any hints, hunches or hopes for what it might be? Any help gratefully received.



Many thanks in advance.



ian.

This was definitely experienced intermittently in the past by other users (probably was back around the time 2.0.14 was released)!



I can only suggest searching thru the bugtracker as I know this was discussed several months ago. Otherwise, I would suggest you upgrade to a later version as this problem did diminish over time. :wink:

[quote name=‘Struck’]I can only suggest searching thru the bugtracker as I know this was discussed several months ago. Otherwise, I would suggest you upgrade to a later version as this problem did diminish over time. ;)[/QUOTE]



Thanks for getting back to me. I’ll have a rummage…but as you say, it looks like it might be time to face the upgrade centre again. :roll:

Just curious, is your server system date/time accurate? Might have cookie expiration issues.



We also ran into AJAX delay issues that were being caused by the beta version of live help polling the site too often. This would cause carts to appear empty if folks shopped too quickly because the AJAX calls were getting delayed (but were completing eventually).

[QUOTE]Thanks for getting back to me. I’ll have a rummage…but as you say, it looks like it might be time to face the upgrade centre again[/QUOTE]



Well, the more you do it, the easier it gets! :smiley:

[quote name=‘Struck’]Well, the more you do it, the easier it gets! :D[/QUOTE]



I might print that out and frame it as a motivational device… :wink:

[quote name=‘jagorny’]Just curious, is your server system date/time accurate? Might have cookie expiration issues.[/QUOTE]



That’s a very good suggestion, actually…although I’ve just checked and the server date/time seem fine. But I very much appreciate the thought nevertheless: it’s the kind of thing that I hoped to get from the support department, to be honest…


[quote name=‘jagorny’]We also ran into AJAX delay issues that were being caused by the beta version of live help polling the site too often. This would cause carts to appear empty if folks shopped too quickly because the AJAX calls were getting delayed (but were completing eventually).[/QUOTE]



Yes, I’ll investigate that further. Again, many thanks for the suggestion.

Hi



After months of intermittent problems with the cart empting. I have a solution (and the problem)



If your site uses categories ie www.yourdomain/shoes/bigfoot and your visitor arrives at this page directly then the cookie sess_id takes shoes/bigfoot as its path.



If your visitor at this point places an item in the cart then either moves to a different category or checkout then the session ID for that path is left and a new session Id is created therefore the new session ID has no data and the cart is empty.



This can be tested if the following manner:



Goto your site at a deep category level ie. www.yourdomain/shoes/bigfoot

Clear your cookies

Refresh the page

Add items to the cart

Either goto checkout or move to a different category = Empty Cart



Go back to the original deep category level ie. www.yourdomain/shoes/bigfoot = Items In Cart





Solution:

It’s a bit dirty and someone may well come up with a neater solution.





Edit core/class.session.php

find the function: static function set_params()



Change session.cookie_path to look like this: ini_set('session.cookie_path', '/');



Go back and test (remember to clear cookies)



Hope that helps someone out :wink:

I had one customer complain about this, but it doesn’t appear to be widespread.



What version are you using, Dean?



I tried it with 2.0.12 and Chrome and did not end up with an empty cart. I haven’t tried other browsers, however.

if this article is true, then it might only be an issue with sites that do not use Apache Rewrite.

[url]https://trac.cakephp.org/ticket/3234[/url]

Thanks both for the feedback



ogia

We are using Version - 2.0.14

We had on average one new complaint a month and how many other didn’t bother letting us know and with an average order being in the hundreds that’s a big deal for us.



tbirnseth

Thank you for pointing me in another useful direction

[quote name=‘Dean’]We had on average one new complaint a month and how many other didn’t bother letting us know and with an average order being in the hundreds that’s a big deal for us.[/QUOTE]



Yes, likewise. Many thanks for posting this, Dean, as it does seem to be fairly close to what people have been seeing.



If I try your steps in IE8, I find that the cart displays correctly in all places except the category where the product was added. It’s pretty much the inverse of what you’re saying, in other words…but it obviously sounds like a related issue. When I try your fix, it works fine.



Again, thanks for that. We’ll see if it makes any difference…but it certainly seems like it might.

Maybe the problem is more common than I thought. While I have lots of orders going through, this is the second person to contact me in the past several days:


[QUOTE]I am trying to place an order with you, but every time I sign in and place something in my cart the next Item I place in the cart deletes everything in my cart.[/QUOTE]



If I can figure out how to duplicate the problem, I’ll implement the fix to see if it works for me.

I was only able to duplicate this once, and it wasn’t through your steps, Dean. I opened IE, visited my store and added a product to the cart. Then I went to check out, logged in, and clicked to another product in the store. At that point it emptied.



I tried to do this again but I never got my cart to empty again!



I made the changes above and told the customer to clear her cookies and try again. She was still unable to check out. However, who knows what’s going on… I asked if she was using IE and she said, no, she is using MSN but found my site on Google. :rolleyes: :confused:

I have seen a similar behavior during development, but it only seems to happen with a particular product.



If I add the product to the cart on the product_detail page, it loads just fine. But if I refresh the page, the Cart shows as empty. But if I click View Cart, the product is there. It’s very odd.



I did notice that in 2.1.2, they made a change in the session manager (file core/class.session.php) that changes:


$current_path = Registry::get('config.current_path');
ini_set('session.cookie_path', $current_path);


to


$current_path = Registry::get('config.current_path');
ini_set('session.cookie_path', ((!empty($current_path))? $current_path : '/'));


But adding this change did not make a difference in my case. I do not know the logic of setting the cookie_path to anything other than the root of the store. I could see making this:


$current_path = Registry::get('config.http_path');
ini_set('session.cookie_path', ((!empty($current_path))? $current_path : '/'));


Since the http_path is really the root of the store… Maybe I found another bug. I’ll have to try this change.



Update: Well, that didn’t fix my problem, but I do believe it is the right solution.

Update2: I’ll take that back… config.current_path is set to either http_path or https_path depending on which mode you are currently in. So code should be correct as it exists in 2.1.2 but in 2.0.x it is probably broken.

Hi

Just a bit more information:



I was using Chrome with the following extensions to read and amend the cookies -

Forget Me & Edit This Cookie both by gr.greyg





To test be sure to enter the site at a category level (also do not sign in) then clear cookies.

Refresh the page, add items to cart then either check out or move category.

Just opened our store and have had two customers out of 71 orders report that they were unable to keep products in the cart while navigating from one product or category to the next. Both were using IE, version unknown. Thanks all for these bits of information which will enable us to get back to these two and further track the issue. One question, where in admin is it possible to track the customers steps through the cart?

Thx

@stevenjak - would really help if you told us what version of the cart you are running. Usually easiset just to make this part of your signature then you don’t have to remember to add it.

[quote name=‘tbirnseth’]@stevenjak - would really help if you told us what version of the cart you are running. Usually easiset just to make this part of your signature then you don’t have to remember to add it.[/QUOTE]



Sorry, will do. I am running 2.1.2

2.1.2 should be current with the session cookie.

Regarding tracking a user’s navigation, you can go to Administration/Statistics but you’ll have to know a bit about them (IP or location) but set the date to “This day” and then find about what time they came in. If you click the visitors link you’ll see info about each visitor. You can track them there.



Don’t have an answer on the empty cart. You could submit to the bugtracker, but if you can’t find a way to reproduce it in the demo store, they probably won’t believe you.