Cart page update automatically when item quantity change

Highlighted
New Member
1 0 3

Scoffaro's solution below works great except for point number 3. I replaced onblur="this.form.submit();" WITH onchange="this.form.submit();". Every time you change the quantity, the cart will be updated.

For anyone still looking for the answer to this:

1. go to your cart-template.liquid code

2. find the quantity input box. should look something like below:

<input class="cart__qty-input" type="number" name="updates[]" id="updates_{{ item.key }}" value="{{ item.quantity }}" min="0" pattern="[0-9]*">

3. add onblur="this.form.submit();"

<input onblur="this.form.submit();" class="cart__qty-input" type="number" name="updates[]" id="updates_{{ item.key }}" value="{{ item.quantity }}" min="0" pattern="[0-9]*">

4. save

 

3 Likes
Highlighted
Shopify Partner
7 0 1

Hi Eliot,

 

regarding this topic, would it be possible to show the total amount of a product on the prodcut page?

 

I mean:

 

I am selling prodcut X for 5€ and if the client update the q.ty to 10 (for example) I would like to show something like :; TOT. 50€ on the product page.

 

I suppose that the main issue was already discussed in this conversation (how to automatically update the amount when someone update the q.ty).

 

Now would you be able to help me to have this function on a product page and just related to the specific product?

 

Thank you,

Hermes 

0 Likes
Highlighted
Explorer
48 2 7

I also want to do this. We have the Venture theme installed for our store. Here's a link: https://www.gainexpress.com/

Email: ela.v.tsm@gmail.com
0 Likes
Highlighted
New Member
4 0 0

Hey I need a little help with my code. I want it to automatically update.

Here is my code:

<div class="grid__item three-third text-center">

                      <label for="updates_{{ item.key }}" class="visually-hidden">{{ 'cart.label.quantity' | t }}</label>
                      <input type="number" name="updates[]" id="updates_{{ item.key }}" class="cart__product-qty" value="{{ item.quantity }}" min="0" data-id="{{ item.key }}">
						<p class="cart__product-meta remove">
                        <a href="/cart/change?line={{ forloop.index }}&amp;quantity=0">
                          {{ 'cart.general.remove' | t }}
                        </a>
                        {% unless item.title contains "Product Replacement" or item.title contains "Product Repair" %}                    
                    {% unless contains_warranty == true %}
                        <div class='winone cps_cart_{{ item.id }}'></div>
                    {% endunless %}
                      {% endunless %}
                      </p>
                    </div>
0 Likes
Highlighted
New Member
3 0 0

Hi 

  I don't see this in assets "district.js"

 

regards

 

Deepak

0 Likes
Highlighted
New Member
42 0 0

Hey,

 

does anyone know how it works for Debutify Theme?

 

Thanks for answer.

0 Likes
Highlighted
Excursionist
23 0 3

Somebody give this guy a medal!! Thanks!!

0 Likes
Highlighted
Tourist
15 0 0

I Have used onclick instead of onblur but, when the quantity gets updated, it takes you to the checkout page directly. Can you help me with that?

 

 

0 Likes