VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: carsten888 on August 14, 2017, 14:00:44 PM

Title: some clients can not add product to cart.
Post by: carsten888 on August 14, 2017, 14:00:44 PM
Every few weeks I get emails from clients who can not click the 'add to cart button'.

I never managed to reproduce the issue. But it keeps coming back.

What could possibly be going wrong here?

VM 3.2.2
J 3.7.4
Title: Re: some clients can not add product to cart.
Post by: jenkinhill on August 14, 2017, 15:06:45 PM
What do you mean by "can not click the 'add to cart button'" ? Is it unresponsive or can't they find it?

Have they selected required custom firlds? Template issue? JavaScript issue?
Title: Re: some clients can not add product to cart.
Post by: carsten888 on August 15, 2017, 07:56:53 AM
the button is unresponsive. This is what one of the clients answered.
Quote
the Add to Cart button does nothing
I've tried in Chrome/firefox and Safari and does nothing when clicked
I would really like to purchase your product straight away so any help would be appreciated.
I don't think there are required fields to add a product to the cart. No template overrides. Maybe javascript issue, but that we should be able to reproduce. I can't reproduce.
Title: Re: some clients can not add product to cart.
Post by: carsten888 on August 20, 2017, 09:08:40 AM
AHA!!!
SOLVED!!!

This happens when you go to the site without www in the url.
http://domain.com does this issue
http://www.domain.com no problem.

How to make it so the site always uses www in the url?
Title: Re: some clients can not add product to cart.
Post by: Milbo on August 20, 2017, 10:52:24 AM
It is the opposite way. Somewhere you set in a config the www, so it works only correct with www, you should just remove it. Maybe in the joomla config, or at your provider
Title: Re: some clients can not add product to cart.
Post by: carsten888 on August 20, 2017, 12:08:30 PM
I took the www out in the main Joomla config at

public $live_site = 'https://domain.com';

that fixed this issue for non-www use, but breaks it for when using www.

any other ideas?
Title: Re: some clients can not add product to cart.
Post by: jenkinhill on August 20, 2017, 12:18:38 PM
Use .htaccess to force removal of www. from urls.
Title: Re: some clients can not add product to cart.
Post by: jjk on August 20, 2017, 12:26:35 PM
Do you have a redirect in your .htaccess file similar to this?
RewriteEngine On
RewriteCond %{HTTP_HOST}  ^www.domain.com [NC]
RewriteRule ^(.*) http://domain.com/$1 [L,R=301]


Also, in case you use the 'Force SSL' setting in Joomla, is your SSL certificate configured for both www and non-www?
Title: Re: some clients can not add product to cart.
Post by: carsten888 on August 20, 2017, 14:34:06 PM
I got it fixed with this
# Force the "www."
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]


thank you all