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

[Solved] VM 2.0.20b Upgrade Breaks Add to Cart Button

Started by ironlion37, March 15, 2013, 23:32:39 PM

Previous topic - Next topic

jenkinhill

Ironlion add to cart does not work in IE10 either, where the new advanced debugger throws up these errors:

HTML1524: Invalid DOCTYPE. The shortest valid doctype is "<!DOCTYPE html>".
capture-medium-detail, line 1 character 1
HTML1423: Malformed start tag. Attributes should be separated by whitespace.
capture-medium-detail, line 347 character 67
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 74
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 75
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=productdetails&task=recalculate&virtuemart_product_id=14&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26virtuemart_product_id%255B%255D%3D14 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.

capture-medium-detail
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26view%3Dcart%26virtuemart_product_id%255B%255D%3D14&_=1364894222862 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
capture-medium-detail

So the host is blocking Cross Origin Resource Sharing (CORS) and preventing add to cart from working in IE10, and this will also affect Firefox. I see you are on Godaddy so I'd suspect you are also using CloudFlare - have a look at http://forum.virtuemart.net/index.php?topic=114127.msg384886#msg384886

Basically the "fix" is either to not use the plugin, or to ensure www. urls and turn off the server cache.

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

ironlion37

#31
Quote from: jenkinhill on April 02, 2013, 11:37:34 AM
Ironlion add to cart does not work in IE10 either, where the new advanced debugger throws up these errors:

HTML1524: Invalid DOCTYPE. The shortest valid doctype is "<!DOCTYPE html>".
capture-medium-detail, line 1 character 1
HTML1423: Malformed start tag. Attributes should be separated by whitespace.
capture-medium-detail, line 347 character 67
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 74
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 75
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=productdetails&task=recalculate&virtuemart_product_id=14&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26virtuemart_product_id%255B%255D%3D14 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.

capture-medium-detail
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26view%3Dcart%26virtuemart_product_id%255B%255D%3D14&_=1364894222862 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
capture-medium-detail

So the host is blocking Cross Origin Resource Sharing (CORS) and preventing add to cart from working in IE10, and this will also affect Firefox. I see you are on Godaddy so I'd suspect you are also using CloudFlare - have a look at http://forum.virtuemart.net/index.php?topic=114127.msg384886#msg384886

Basically the "fix" is either to not use the plugin, or to ensure www. urls and turn off the server cache.

Thank you Jenkhill. I talked with GoDaddy and they assured me they are not blocking CORS. I'm not using CloudFlare and server caching is turned off.

Just in case they had me install this xml file in the root (crossdomain.xml):
<?xml version="1.0" encoding="utf-8"?>

<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

and using this jquery .ajax() function worked.

$.ajax({
url: 'http://www.jesseheath-artist.com',
type: 'GET',
async: false,
data: {},
crossDomain: true,
//dataType: 'jsonp',
success: function(data) {
alert(data);
},
error: function(xhr, testStatus, error) {
alert('Error n' + error + 'n Status: ' + testStatus + 'n xhr:' + xhr);
}
});


Any more thoughts?

And perhaps a better question: is it possible to roll back to 2.0.18?

ironlion37

Jenkhill,

I have set up a fresh install of Virtuemart 2.0.18a. It is hosted on GoDaddy also:

http://www.thecrystalcache.com/newsite/index.php/test-category/test-product-detail

You'll note that on this installation, you can add the test product to the cart in Firefox (and I assume IE 10). This confirms that the break in 2.0.20b is indeed limited to the Virtuemart software. As I stated in the beginning on the www.Jesseheath-artist.com site, the problem only appeared after upgrading virtuemart to 2.0.20b.

Since I have the two versions up for testing, how can I help diagnose this problem so it can be fixed for the next release?

Thank you.





Joseph Kwan

#33
Look like there is a mix of domains on the page: some domain has www and some does not. This will cause javascript to post the add to cart data to a wrong session.
Make sure the domains set everywhere are the same, either with or without www. I've tested the site with http://jesseheath-artist.com without problem while accessing the site http://www.jesseheath-artist.com will not add product to cart.


Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

ironlion37

Quote from: Joseph Kwan on April 12, 2013, 20:51:27 PM
Look like there is a mix of domains on the page: some domain has www and some does not. This will cause javascript to post the add to cart data to a wrong session.
Make sure the domains set everywhere are the same, either with or without www. I've tested the site with http://jesseheath-artist.com without problem while accessing the site http://www.jesseheath-artist.com will not add product to cart.

THANK YOU JOSEPH!

Made sure "URL" field under Shop >Vendor Information and public $live_site = in configuration.php both contained www and that fixed the problem.

tmdonovan

I have the same problem - when using domain.com instead of www.domain.com, add to cart popup doesn't display in some browsers.  It works fine for www.domain.com.

I checked the URL in Shop/Vendor Information and it is http://www.domain.com.  $live_site joomla variable is also http://www.domain.com.  Why does this not work?  BTW, I am on VM 2.0.21b.

Thanks for your help.

Joseph Kwan

Search through the page source to see if there are mixed domains. Or post a samples site url for checking.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.