View Single Post
  #7  
Old 02-19-2011, 12:08 AM
  enterfusion's Avatar 
enterfusion enterfusion is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Pittsburg, CA
Posts: 70
 

Default Re: Custom Add To Cart Button with AJAX Possible? 4.3

I have to agree, we had some developers work on changing our cart around, now the ajax buttons don't work, spent three hours on it, but had to come up with a hack workaround cause I didn't know how to fix the this.box.length issue.

The code for changing this out as a animated gif is overly complex, they would have done better to just swap out the entire button element and then put it back when done, but they are doing all sorts of nasty stuff with the DOM and looking for span tags with specific classes attached to them like span.button-right and span.button-left, all I can say is I never would have designed something so overly complicated.

THIS IS WHAT I HAD TO CHANGE (bad workaround) if someone could tell me the real issue, I would like to know.

// Widget :: check - ready widget or not
ajax.widgets.add2cart.obj.prototype.isReady = function() {
this.box.length = 1; //new code added for fix to problem
return this.form.length > 0 && this.productid > 0 && this.box.length > 0;
}
__________________
-Eric

X-cart 4.3.2 up and running.
Apache, PHP 5.2, APC, Redhat, Checkout One, On Sale, Smart Search, Remember Cart.
Lots of other customization's, but perhaps typical of x-cart installations.

X-cart 5 sort of in limbo, trying to make things work without much luck.
Reply With Quote