How to fix "shopping cart is empty" (when it's not) problem in Virtuemart.

Error: Shopping cart is empty and virtuemart logo

If you have vVrtuemart installed in Joomla and test the shopping cart only to find that although the cart has items in it, the error "Cart is empty" appears when you click "process order", Here is a solution suitable for most Virtuemart users.

The error "Cart is empty" is often a problem with the session. The most important thing is that the two site addresse fileds in virtuamart configuration and your joomla configuration files are formatted the same way. i.e. both have www. The most common occurrence of this error is when one has www but not the other.

To fix it, log in to Joomla administrator backend and then go to virtuemart>configuration>security

In the security tab of the virtuamart configuration you will see two addresses: "Site URL" and "SECUREURL". If these addresses don't both use "www." at the front then you will no doubt see the "Cart is empty" error. NOTE: the Site URL can be http and the SECUREURL can be https, that is actually correct for a secure site, but they should both be formatted with "www." if not, Joomla considers these different sessions and when you click "process order" Joomla effectively thinks you are in another site, one which has goods in the shopping cart and on without. So the "Shopping Cart is empty" error is not strictly incorrect because Joomla thinks that's the case.

If that does not help. Try this: Go to the Joomla administrator backend and click on the configuration icon (or go to to the menu  site>Global Configuration). Click on the Server tab. Under server settings you will see the option "force SSL". Try swithing it to "none".

If you get the "shopping cart is empty" error and both the site url and the secureurl are correctly formatted and the force SSL setting is set to none, I can't tell you much more than that it is a session problem. If you are using any SEO or URL rewriting plugins, try turning them off for the virtuemart component (or off completely). You can also edit the ps_session.php but some php knowledge is require and I can't tell you what changes should be made. Remeber to backup ps_session.php file before you make changes.

This should fix the "shopping cart is empty" problem for most people, please comment on your experience. Good luck!

Posted in Joomla