I recently had to move my site to another address, and have now moved it back to the original address again.
The issue I am having is the site loads up fine, whether the address be www.shop.rpw.com.au or shop.rpw.com.au
But it will only add products to the cart if you are using the address shop.rpw.com.au. IF you add the www in front it just sits there thinking whenever you try to add a product to the cart.
I had siteground (Host) look into this and they changed the .htaccess file apparently to setup the redirect but it didn't make any difference, the problem still exists and they believe its a hard coded issue.
I have updated to the latest versions being
Joomla! 3.9.11 Stable [ Amani ] 13-August-2019 15:00 GMT
VirtueMart 3.6.0 10113
I really have no idea where to proceed from here. Any help would be appreciated.
Try to empty livesite in the Joomla config.
it doesn't work because
Access to XMLHttpRequest at 'http://shop.rpw.com.au/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=en&Itemid=896' from origin 'http://www.shop.rpw.com.au' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
try the htaccess force the other way around -- i.e. no www
Thank you very much that worked perfectly and the site is now running properly again. Is there a reason why this is happening though? Surely this is not something you would normally need to do.
It depend the apache settings. see for eg. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin
If yuou use a cache then the links can be bad.
It's why always redirecting to non WWW should be used, to prevent this problem.
If you set livesite in the config. Then you can have same problem.
simple explanation : ajax calls etc must to/from the identical domains - otherwise the browser will block it .. this is for security