Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have been searching for a while, this. I want to add an item via AJAX. When you add an item to a cart in Woocommerce the page reloads with the GET parameter add-to-cart="The current product ID".

I want to do it via AJAX. In the admin area is a checkbox to enable that featured that is labeled "Enable AJAX buttons to add to cart on the product list"

But it doesn't do anything, it stills reloading the page.

share|improve this question

closed as off-topic by Rarst Dec 23 '13 at 12:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should be specific to WordPress within defined scope (merely happening in its context, such as generic PHP/JS/HTML/CSS, is insufficient). Might be better asked at Stack Overflow or other appropriate site of Stack Exchange network." – Rarst
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Explanation in Spanish? Honestly? –  kaiser Nov 22 '12 at 0:23
    
"Enable AJAX buttons to add to cart on the product list" g.translate –  david Nov 22 '12 at 1:11
    
@david as I wrote, I checked the enable AJAX button, but it doesn't do anything. –  jepser Nov 23 '12 at 1:59
    
This was no advice from my site, I was just translating your Spanish sentence :) –  david Nov 23 '12 at 9:39
    
@jepser did you ever find out the answer to this question? Its been bugging me aswell. –  Lucky Luke Jan 29 '13 at 19:31

1 Answer 1

up vote 1 down vote accepted

are we talking about the single product view or the product archive pages (shop,categories)?

because the text beside the checkbox/option states, roughly translated:

»activate ajax-checkout-button on product archive pages«

and on all the installations i did so for, that is the way its working - ajax checkout on the archives, but not on the single view.

the latter you have to implement yourself or maybe you find a free plugin for that.


Follow up:

A basic example on how to use AJAX for the »add-to-cart«-functionality of woocommerce can be found here: Woocommerce - Add a product to cart programmatically via JS or PHP.

share|improve this answer
    
This is correct. The ajax add to cart option is only for product archives. To do add-to-cart via ajax on the single product page, you'd need to set up a jQuery click event and do the ajax call there. –  helgatheviking Aug 3 '13 at 20:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.