Skip to content

Instantly share code, notes, and snippets.

@stunomatic
Created January 6, 2017 04:16
Show Gist options
  • Save stunomatic/eba27165272c9f64c704cd62f7a1482a to your computer and use it in GitHub Desktop.
Save stunomatic/eba27165272c9f64c704cd62f7a1482a to your computer and use it in GitHub Desktop.
WooCommerce auto-update cart when variable selected.
This is the website with single product URL: http://stunomatic.com/amp/donation/
I hide the cart button and now I want to update cart when someone select variable or type value in input field.
how I can do that please advice
@stunomatic
Copy link
Author

I customize this script but getting one error " Please choose product options"

` jQuery(document).ready(function($) {
var add_to_cart_btn = $(".single_add_to_cart_button");
// add_to_cart_btn.hide();
$("ul.donate-now").find("li").on("change", function(){
add_to_cart_btn.trigger("click");
});
});

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment