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

Add to cart not working on some devices

Started by chaldama, October 31, 2017, 09:47:14 AM

Previous topic - Next topic

chaldama

Hello all,

Currently one of the websites I monitor is having a weird problem. On some computers/tablets/phones the add to cart button is not functioning. The spinning wheel just keeps loading but products never actually make it to the cart. For me it's difficult to test this, since on all my own devices there is no problem. There are no errors in log files, all extensions are up-to-date.

This is the URL: https://vergaderkoffers.nl
PHP Version 5.6.31, Joomla 3.8.1, VirtueMart 3.2.4. Yootheme template Monday, VMUikit 4.5.4

In other posts I could not find anything helpful.

Jumbo!

The issue has nothing to do with the devices. It is a cross origin Ajax call issue of your site.

Add to cart will not work if you access your site with this url - https://www.vergaderkoffers.nl But if you try with this url - https://vergaderkoffers.nl then it will work fine.

It is a basic "www" and "non-www" prefix resolving issue.

Your domain name should never resolve both with "non-www" and "www". That means the site should be made accessible either using www.your-site.com or your-site.com.

You need to make sure that www requests are redirected to no www. Which will also improve your search engine/crawler performance. Refer to this StackOverflow post for more details: https://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www This will resolve your problem. Basically you just need to add the following redirect rules in your .htaccess file.

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

chaldama

Thank you Jumbo, this was however not the problem. I do agree to the fact that it would be better if the Joomla .htaccess would be adjusted in the core file to enable the rewrite from non-www to ww or vice versa.

Problem is solved by disabling the offcanvas cart en using the normal VM cart instead.

Studio 42

Solved or not, you should add the RewriteRules for google SERP

aftertaf

what do you mean by the offcanvas cart ?
I have had reports of similar issues on my website when people are using iPhones but I don't have one to test with...
Gonna try the .htaccess change too FWIW...
I'm not currently using HTTPS, can I apply the above change all the same ?
David

chaldama

I also changed the .htaccess just to be sure, for a non-SSL site just change https to http and it should work.
I used to use the offcanvas cart extension from VMUikit

Studio 42

Check with vmuikit support or disable it and check with Joomla protostar template.