Checkout from mini-cart shows EMPTY CART on Chrome only

Permalink
Very strange that I don't see anyone else having this problem. When checking out using Chrome, the cart shows empty.

Steps to reproduce:
1) Visithttp://kristinit.com/index.php/shop/magenta-silk-jade-dress/... on Windows Chrome.
2) Add product to cart (after selecting size).
3) Click Check Out

You'll probably see an empty cart page saying there's no products in cart. Click Back button, and you can still see the product is in your cart. I've tried repeating, clearing cache, etc. and still broken.

This ONLY happens in Chrome, and not all instances. My desktop browser works, yet my Chrome browser at work doesn't. Chrome on my Galaxy Note 10.1 Android does not work. And we've had emails from our customers that they are also having problems and cart empties out. I've had to put a custom message for Windows Chrome visitors on our product page to use another browser!

Any ideas folks? I'm kind of stumped and considering recreating whole site using latest version which would take a lot of time. Much appreciated,
Gary

Concrete5 - 5.4.1.1
eCommerce - 2.0.8

garyam
 
mesuva replied on at Permalink Best Answer Reply
mesuva
Hi garyam,

I think there's a simple explanation to this, there's no actual bug or problem here (so don't blow the site away!):

- The link you have given is kristinit.com, WITHOUT a www. Using this address you add an item to the cart
- When you click the checkout link, the site is redirecting to http://www.kristinit.com (so WITH a www)
- Those two addresses are effectively different websites, so the session cookies aren't going to carry across.

You can confirm this by going to your site with www in the address first - the site then works as expected.

So to fix, all you really need to do is edit your site.php or .htaccess file to force viewing the site always with (or without) the www.
garyam replied on at Permalink Reply
garyam
Powahh, you nailed it. What a simple fix to something that was potentially gonna give me a ton of work... Thank you, Mesuva, you rock.
AnaNedic replied on at Permalink Reply
AnaNedic
I have the same problem.
For me it works only if I force the site to use www. If I force everything to no-www, then it doesn't work. But I would actually like my site not to use www at all.

Can you please give me the code that you used?

Thank you,
Ana
garyam replied on at Permalink Reply
garyam
It may be different for your hosting provider, but with webfaction hosting I created a Static/CGI/PHP-5.4 application for the domain "kristinit.com" (no www) and named it "redirect_to_www".

Then, in that "redirect_to_http" web application directory (which is pretty much empty), I added an .htaccess file with the below code:

# -- redirect to www --
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^kristinit.com$ [NC]
RewriteRule ^(.*)$ http://www.kristinit.com/$1 [R=301,L]


And that does the redirection if someone enters kristinit.com instead ofhttp://www.kristinit.com.
AnaNedic replied on at Permalink Reply
AnaNedic
Thanks a lot Gary!