Skip to content

Instantly share code, notes, and snippets.

@bhavik-kiri
Last active June 21, 2017 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhavik-kiri/401f7b2f0ed2169ae0efd881cf2c2896 to your computer and use it in GitHub Desktop.
Save bhavik-kiri/401f7b2f0ed2169ae0efd881cf2c2896 to your computer and use it in GitHub Desktop.
It will call the ajax when customer click on the quantity button
jQuery(function( $ ) {
$( "form.checkout" ).on( "click", "input.qty", function( e ) {
var data = {
action: 'update_order_review',
security: wc_checkout_params.update_order_review_nonce,
post_data: $( 'form.checkout' ).serialize()
};
jQuery.post( add_quantity.ajax_url, data, function( response )
{
$( 'body' ).trigger( 'update_checkout' );
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment