News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Cart empty after registration or logging in?

Started by alexzien, November 28, 2012, 11:32:11 AM

Previous topic - Next topic

alexzien

When a new customer enters the page and add a product to the cart and then goes to checkout he/she is told to login or register for a new account. When the customer choose to do any of these choices the cart becomes empty.
This only happen the first time the customer visits the webshop. When he/she comes back and do the same thing the cart saves the added products even after logging in or registering.

Anyone who know how to solve this? It's very important that a customer can add a product to the cart before he/she chooses to login or register for an account.

I have tried to change how Joomla handles cookies and the time for session handler.
Could it have something to do with this? http://forum.virtuemart.net/index.php?topic=82238.msg271150#msg271150. But it says that this don't apply to VirtueMart 2.0+ versions, which I have...

Joomla 2.5.6
VirtueMart 2.0.12f

alexzien

Solved it! The problem accured when customers entered the site without using www. Because when you add a product on the site without www. and then go to checkout the site redirects to www. and then the products dont get saved.

Therefor I had to add the following code to the .htaccess file:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


This redirects customers to the www. site even if they dont type in www in the address bar.