Custom coding a quantity selector - I'm lost

Solved
Highlighted
Tourist
14 0 1

Hello everyone,

 

I'm currently building a site for a client and the client wishes to have a quantity selector inside the cart like this: 

Screenshot_14.png

 

Styling is the easy part, making it work with Shopify is the hard part. What do I need to code here to make this work? I found numerous tutorials and guides but none of them were directly for Shopify or were outdated. 

Sadly I'm still not the best at coding JavaScript and Liquid so this is extra challenging for me.

If you can point me in the right direction, that would mean a lot.

 

Greetings

Timo

0 Likes
Highlighted
Shopify Partner
28 4 10

This is an accepted solution.

@TLKHH Shopify works in a way, that even if you adjust or decrease the quantity, you need to send an AJAX request https://shopify.dev/docs/themes/ajax-api for cart update, and to refresh the Cart page after that. Without it, total and subtotal values will be not updated. 

Check this tutorial: https://community.shopify.com/c/Shopify-Design/How-to-add-quantity-Button-to-cart-page-Jumpstart-The... . But do not forget to make a POST to AJAX Shopify API, with refreshing the page after that.

But frankly speaking, this small fix requires real work, and if you are struggling with it, you'd better hire some dev for a couple of bucks. In this case, you will get a qualified result and will not spend your time doing it by yourself.