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 button not working

Started by centinela, September 28, 2020, 13:32:51 PM

Previous topic - Next topic

centinela

Joomla 3.9.12
Virtuemart 3.8.4
PHP 7.3

Hello,

In my shop https://www.jcmackintosh.es/vm.html?lang=es the add to cart button does not work for any product. Any ideas please? Thank you.


jenkinhill

Console shows a JavaScript problem. You are loading a version of jQuery through your phocaupgrade plugin which I think is incompatible with VirtueMart.

Try to disable that plugin and enable VM jQuery
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

centinela

Thank you Jenkinhill,

I disabled Phocaupgrade plugin, and VM JQuery UI scrips in Core Css Styels & Javascritps under templates in configuration was already enabled. As a result a thinking rotating wheel shows up (for the first time, I think), but it seems to get stuck there.  :-\ Any ideas please? Thank you,

GJC Web Design

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://jcmackintosh.es/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=es&Itemid=429. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

you need to force either www or no www

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

in your .htaccess
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

centinela

#4
Thank you GJC, in order to force www I added the the .httaccess file

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

but the add to cart button keeps on not wanting to work.

Is there anything I did wrong? Thank you,

GJC Web Design

it is still showing

The Same Origin Policy disallows reading the remote resource at https://jcmackintosh.es/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=es&Itemid=429.
(Reason: CORS request did not succeed).

I have no idea why the ajax call isn't using www

you could try forcing no www

# match any URL with www and rewrite it to https without the www
RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC]
RewriteRule (.*) https://%2%{REQUEST_URI} [L,R=301]

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jumbo!

Open the configuration.php file located at the root of your site. Find the following codes -

public $live_site = 'https://jcmackintosh.es';

Replace above by:

public $live_site = '';

Save the file. This will resolve the problem.


centinela