Looking at this page, I’m receiving an ‘Uncaught TypeError: addtocart.off is not a function’. I’m assuming it’s because of the jQuery version that is loading, but wanted to get another set of eyes to look at it.
The ‘addtocart.off’ is coming from this code:
if (typeof CustomfieldsForAll === "undefined") {
var CustomfieldsForAll = {
handleForms : function(forms) {
forms.each(function() {
var form = jQuery(this);
var addtocart = form.find('.addtocart-button');
addtocart.off('click'); <-------
// addtocart.unbind();
addtocart.click(function(e) {
var form = jQuery(this).parents('form');
var requiredChecked=CustomfieldsForAll.checkRequired(form);
if(requiredChecked)Virtuemart.sendtocart(form);
return false;
});
});
},
The code you see is what Chrome is catching as the Uncaught Type Error. I’m not familiar with the two items of the same class, but I am curious on how this problem can be solved.
If the find returns multiple results then the off method would apply to each separately and not to the entire nodelist at once - producing exactly the error you are getting.
Try checking what addtocart contains after the find is assigned.