Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function(){
- jQuery('#shopping-cart-table')
- .on(
- 'change',
- 'input[name$="[qty]"]',
- function(){
- var form = jQuery(jQuery(this).closest('form'));
- // we'll extract the action and method attributes out of the form
- // kick off an ajax request using the form's action and method,
- // with the form data as payload
- jQuery.ajax({
- url: form.attr('action'),
- method: form.attr('method'),
- data: form.serializeArray()
- });
- }
- );
- var formData = form.serializeArray();
- formData.push({'update_cart_action' : 'update_qty'})
- jQuery.ajax({
- url: form.attr('action'),
- method: form.attr('method'),
- data: formData
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement