Author Topic: My add to cart button does not work  (Read 28681 times)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28746
  • Always on vacation
    • Jenkin Hill Internet
My add to cart button does not work
« on: February 20, 2011, 18:33:12 PM »
A lot of VirtueMart users have a problem where they cannot add a product to cart or the cart delete/update icons do not work, often giving a redirect to the home page, or the cart is empty after registration. This is usually due to inconsistency of url in configuration. You must use either http(s)://www.domain.com/ or http(s)://domain.com/ -  ie with or without the www. which are seen as a different domains in modern browsers. FireFox and other modern browser security will not transfer the session to the "new" url.

Make sure that siteurl and secureurl In VirtueMart configuration/security are both set to whichever format you choose and use .htaccess at the Joomla root on the server to force all urls to use that format.

My view is that it is better to use www. as shoppers know that that is something to do with a web address, and where a site url is published in print, the standard now is to use www.domain.com (ie to include the www). Additionally, forcing a www. url is good for SEO reasons.

*sometimes a failure to add to cart is caused by a JavaScript conflict where a script from the Joomla template or another module causes an error. This is usually spotted by an error on page message appearing at the bottom of IE's browser window. Use web developer tools, such as in IE8/9 or Firebug to indentify the cause.

Note: the above applies to the old VirtueMart 1.1 versions not to the current VirtueMart 2.0+ versions.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.2.5 10924 J! 3.10.11 PHP 8.2.7