CART PAGE INPUT QUANTITY CHANGE AUTO UPDATE PRICE BASED ON QTY

Excursionist
26 0 4

Hi,

I am trying to make the shopify ajax api works so when customer add products in cart, then when changed his mind and try to increase/decrease number of product, he/she don't need to click "UPDATE" button.

I know this is possible but i can't make it work.

1 Like
Explorer
83 0 25

Hi,

You can try triggering the button click with jquery when the input field is updated. The code below is assuming that the input has the class of "qty-input" and your button has the id of "cart_update". You may need to change those depending on what your classes/id's are for those elements.

$('.qty-input').on('input', function() {
	$( "#cart_update" ).trigger( "click" );
});

 

4 Likes
Highlighted
Excursionist
26 0 4

THANK YOU SO MUCH!!!!

0 Likes
New Member
1 0 0

Thank you so much. Working like a charm!

0 Likes