VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: postkat on October 23, 2018, 12:18:33 PM

Title: Add to cart not working on English website - SOLVED
Post by: postkat on October 23, 2018, 12:18:33 PM
Hi there,

On this website there are two domains: https://www.daylightlamps.ie (https://www.daylightlamps.ie) and https://www.truelightdaglichtlampen.nl (https://www.truelightdaglichtlampen.nl).
There are no add to cart problems on the Dutch site but on daylightlamps.ie the add to cart button is not working. The pop-up doesn't appear.
I think this problem started with VirtueMart 3.4.2.

Also tested in beez3 and the problem remains.

Joomla and Virtuemart latest version, PHP 7.2

Regards,
Dorine
Title: Re: Add to cart not working on English website
Post by: jenkinhill on October 23, 2018, 12:32:33 PM
You have this error on add to cart:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.truelightdaglichtlampen.nl/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=en&Itemid=584. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
Title: Re: Add to cart not working on English website
Post by: GJC Web Design on October 23, 2018, 12:41:25 PM
Yes -- your posting your .ie add to cart to

https://www.truelightdaglichtlampen.nl/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=en&Itemid=831

how did u manage this?

see your .ie source

var vmSiteurl = 'https://www.truelightdaglichtlampen.nl/' ;

Title: Re: Add to cart not working on English website
Post by: postkat on October 23, 2018, 13:03:43 PM
Thank you!
I enabled CORS and the problem is solved.

Regards, Dorine
Title: Re: Add to cart not working on English website - SOLVED
Post by: GJC Web Design on October 23, 2018, 15:10:39 PM
so u really want to add to cart in the .nl site from the .ie site???
Title: Re: Add to cart not working on English website - SOLVED
Post by: postkat on October 23, 2018, 15:18:24 PM
No I found something in the Joomla configuration file that was the cause of this problem, $live_site was filled. I don't do that usually.....
Title: Re: Add to cart not working on English website - SOLVED
Post by: GJC Web Design on October 23, 2018, 19:58:45 PM
interesting --  so var vmSiteurl takes its value from the Jconfig if live_site set?