Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

AJAX Add to Cart Issue

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-30-2011, 01:36 PM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default AJAX Add to Cart Issue

Hi All,

I'm having a strange issue with the Ajax add to cart functionality. The add to cart function is working properly, but when the add to cart button returns to it's normal "state" after a product is added, the custom styling I've done to my select boxes goes away:

http://future.thefutureforward.com/~field/product-one.html

I'm using the jQuery UI-based "selectmenu" plugin to replace the select menu styles.

I'm guessing it has something to do with the "ajax.widgets.add2cart.obj.prototype.cleanAddedSta te" function in the "common_files/js/ajax.add2cart.js" file, but just adding the js calls for "selectmenu" into that function doesn't work.

Any thoughts on why those select boxes are losing their styling when a product is added would be much appreciated!!
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
  #2  
Old 09-30-2011, 04:24 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,195
 

Default Re: AJAX Add to Cart Issue

This is happening because in here - /include/func/func.ajax.php - at the end of each function the original template is called and it replaces whatever is there on the page. I still can't figure out why it is designed that way (4 versions already), it seems unnecessary thing to do. You can either comment out lines like this

Code:
return func_display('customer/main/product_details.tpl', $smarty, false);

Or replace with yoru own template
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
nickff (09-30-2011)
  #3  
Old 09-30-2011, 07:25 PM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default Re: AJAX Add to Cart Issue

Steve,

That is quite odd, indeed. Commenting out that line did the trick. Thank-you SO MUCH for this tip.
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
  #4  
Old 03-03-2012, 08:05 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: AJAX Add to Cart Issue

I thought I'd add a side note to this, you can also use the ajax template call to call a different template after add to cart. Very handy if you want to pop up a continue shopping or checkout button after add to cart has been pressed.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:22 PM.

   

 
X-Cart forums © 2001-2020