Customers able to add more quantity to cart than what's available

megreddy29
New Member
2 0 1

Hi there! I've spent hours trying to figure this one out, hoping someone can help!! 

I noticed that on a product page, customers are able to add multiple quantities of an item to their cart, even when I don't have that many available. For example, I may have only 2 of a single item available but a customer can add even 8 or 9 using the quantity drop down on the product page. They only get notified that we don't have stock once they get to the check out page. So they won't be able to purchase more than what's in stock, but it's still a poor customer experience being able to select high quantities when they aren't actually available. Is there any way to limit the number in the quantity box drop down to what is actually available? 

I did see this page here with a solution but it didn't seem to work for me. I'm using Shopify's free Debut theme. I can figure out how to make simple edits to existing code but I am in no means a coder! 

Any help would be much appreciated!!!

Replies 15 (15)
PaulNewton
Shopify Partner
5189 464 1125

You may want to first enable inventory tracking on the product and set the inventory policy to deny , for when products are sold out.

 

The customization you referenced is mainly about notifying or correcting excess quantities not actually preventing it in the first place

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
megreddy29
New Member
2 0 1

Hi there, thanks - I have actually done that already but like you said, I'm just trying to notify customers when they select a quantity of an item that I don't have in stock (rather than prevent them from buying it, as I know this won't happen).

sallyridgway108
Excursionist
17 0 21

I am also struggling with this one, seems like a simple thing that Shopify should have in place as standard.

I get drop outs at the checkout because customers add too many items to their cart them just give up at the time you need them to continue. Very frustrating. Any idea when Shopify will link this to our tracked quantity?

Thank you 

CiaoBella
Tourist
9 0 8

Really hoping someone replies to this and Shopify has it fixed! This is something that should be standard, why track inventory if it's not going to prevent a customer from adding too many of an item to their cart and to only give them an error at checkout. Talk about lost sales! 

PaulNewton
Shopify Partner
5189 464 1125

@CiaoBella this often has more to do with the theme than with shopify itself.

To help with this customer experience issue shopify as an advanced customization: 

 https://community.shopify.com/c/Shopify-Design/Cart-Prevent-orders-for-out-of-stock-items/td-p/61492...

There is another basic customization that could also be repurposed by those with coding experience possibly in some cases:

  https://shopify.dev/tutorials/customize-theme-hide-variants-that-are-sold-out

 

Merchants can buy this customization directly by contacting me paull.newton+shopifycustomizations@gmail.com

 

 

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
CiaoBella
Tourist
9 0 8

I see it's for in the cart page, I want the quantity to max out for whats available for each variant on the product page so it doesn't inconvenience the customer by putting what they think they can get into the cart and then telling them sorry not all available. 

roots
Tourist
9 0 0

Did you ever find a solution to this? I've been trying to figure it out for weeks with no help from Shopify.

CiaoBella
Tourist
9 0 8

And it's frustrating that some themes, probably paid more expensive themes, offer the option but some do not. 

baromarket
New Member
1 0 0

Hi,

Did you find a solution for this? 

We are facing the same issue

 

Thank you, 

roots
Tourist
9 0 0
I wound up buying a $180 theme. Shopify was no help whatsoever.
Toni11
New Member
3 0 0

Which theme did you buy please?

jocelynkellner
Excursionist
27 0 1

I am also having this problem. Did anyone find a solution? Or find a theme that is very similar and supplies this? This should be automatic from Shopify.

rachlstan
Tourist
5 0 2

Having the same issue with the Minimal template.  Any solution? 

PaulNewton
Shopify Partner
5189 464 1125

If your having an issue of this type or any type with shopify it's important to always provide clearsimple details for any possible future troubleshooting or answers

  • Theme name
  • What the current inventory settings are
  • What exact problem your having whether it's on product page, or cart page if you need buttons disabled or just a message ,etc
  • Store name, or reference urls to replicate problem

Goodluck!

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
Chestnut
New Member
1 0 0

I'm having the same problem; I'll try to be specific.

- In my cart, customers are able to change the qty of a product by typing a number, and the cart updates to this qty even if it exceeds the total inventory for that product. I want to edit the code so that it

- Using Debut theme

- I have tried this suggestion but either I don't understand the instructions, or my apps have created additional code that makes it impossible to follow them. My cart.liquid file looks like this:

{% comment %}
The contents of the cart.liquid template can be found in /sections/cart-template.liquid
{% endcomment %}
{% section 'cart-template' %}

This means that Step 5 is impossible

 

5) In the same file, locate the following:

value="{{ item.quantity }}" 

because value="{{ item.quantity }}" is not part of this file.

I tried going to the cart.liquid template in /sections/cart-template.liquid and modifying the code there instead, but this didn't work (or I did it wrong). In that file, there are two instances of value="{{ item.quantity }}" and I wasn't sure which to modify. Below is the section of code that includes value="{{ item.quantity }}" in my /sections/cart-template.liquid file. Any suggestions on how to modify would be much appreciated.

<div class="cart__qty medium-up--hide">
<label for="updates_{{ item.key }}" class="cart__qty-label" aria-label="{{ 'cart.label.quantity' | t }}" data-quantity-label-mobile>
{{ 'cart.label.qty' | t }}
</label>
<input id="updates_{{ item.key }}" class="cart__qty-input" type="number"
value="{{ item.quantity }}" min="0" pattern="[0-9]*"
data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-mobile data-role="product-quantity-mobile">
</div>
<div class="cart__qty-error-message-wrapper cart__qty-error-message-wrapper--mobile hide" role="alert" data-cart-quantity-error-message-wrapper>
<span class="visually-hidden">{{ 'general.accessibility.error' | t }} </span>
{% include 'icon-error' %}
<span class="cart__qty-error-message" data-cart-quantity-error-message></span>
</div>
</td>
<td class="cart__quantity-td text-right small--hide">
<div class="cart__qty">
<label for="updates_large_{{ item.key }}" class="cart__qty-label" data-quantity-label-desktop>{{ 'cart.label.quantity' | t }}</label>
<input id="updates_large_{{ item.key }}" class="cart__qty-input" type="number"
name="updates[]" value="{{ item.quantity }}" min="0" pattern="[0-9]*"
data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-desktop data-role="product-quantity-desktop">
</div>
<div class="cart__qty-error-message-wrapper cart__qty-error-message-wrapper--desktop hide" role="alert" data-cart-quantity-error-message-wrapper>
<span class="visually-hidden">{{ 'general.accessibility.error' | t }} </span>
{% include 'icon-error' %}
<span class="cart__qty-error-message" data-cart-quantity-error-message></span>
</div>
</td>
<td class="cart__final-price text-right small--hide" data-cart-item-line-price>