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

ajax add to cart button

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 09-26-2012, 12:12 AM
 
xcartukguy xcartukguy is offline
 

Member
  
Join Date: May 2012
Posts: 17
 

Default Re: ajax add to cart button

Quote:
Originally Posted by Brett Forsyth
I am having a similar issue. What class where you missing?

Code:
<div class="details"> <form name="formname"> <input type="submit" onclick="!ajax.widgets.add2cart(formname)" value="Buy" /> OR <a href="#" onclick="!ajax.widgets.add2cart(formname)">Buy</a> </form> </div>

That worked for me but the button only works once; I need to find out how to reset it.

I suggest the input though so you've got a fallback for non-javascript useability.
__________________
X-Cart 4.3.1
X-Cart 4.5.4
Reply With Quote
  #12  
Old 09-26-2012, 10:13 AM
 
Brett Forsyth Brett Forsyth is offline
 

Newbie
  
Join Date: Jun 2012
Posts: 2
 

Default Re: ajax add to cart button

Was there JS files you were missing though? I have been through everything and can't seem to find anything missing. The code is the same as the default theme but I can't get it to stop reloading the page.
__________________
x-cart 4.5
Reply With Quote
  #13  
Old 09-26-2012, 10:17 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 button

Quote:
Originally Posted by xcartukguy
I suggest the input though so you've got a fallback for non-javascript useability.
Forget user's without JavaScript. Javascript is required for todays web to function. Just my opinion.
__________________
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
  #14  
Old 09-27-2012, 12:49 AM
 
xcartukguy xcartukguy is offline
 

Member
  
Join Date: May 2012
Posts: 17
 

Default Re: ajax add to cart button

Quote:
Originally Posted by Brett Forsyth
Was there JS files you were missing though? I have been through everything and can't seem to find anything missing. The code is the same as the default theme but I can't get it to stop reloading the page.

I just used the default template... and removed things.

Quote:
Originally Posted by totaltec
Forget user's without JavaScript. Javascript is required for todays web to function. Just my opinion.


But using an input means you still have functionality without javascript and looks the same.
__________________
X-Cart 4.3.1
X-Cart 4.5.4
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 10:46 AM.

   

 
X-Cart forums © 2001-2020