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

Virtuamart www Issue not adding anything to the Cart

Started by Mitsiman, September 18, 2019, 07:03:39 AM

Previous topic - Next topic

Mitsiman

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.

Studio 42


GJC Web Design

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
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

Mitsiman

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.

Studio 42

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.

GJC Web Design

simple explanation : ajax calls etc must to/from the identical domains - otherwise the browser will block it  .. this is for security
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