PLEASE HELP! Prevent customer to from buying more than what is available in inventory

Topic summary

A Shopify store owner needs help preventing customers from exceeding total inventory across product variants.

The Problem:

  • Store has only 2 units of yellow brass total in inventory
  • Product has 2 variants: pendants and necklaces
  • Customers can currently add 2 pendants + 5 necklaces to cart (7 total items)
  • Owner wants the “Add” button to show “Sold Out” once the 2 yellow brass units are in cart, regardless of which variant combination

Attempted Solution:

  • One user suggested enabling inventory tracking and unchecking “Continue selling when out of stock” in Shopify admin
  • Store owner confirmed these settings are already configured
  • Issue persists: customers can still add more items than available (e.g., size 14 and 16 necklaces totaling 4 yellow brass units when only 2 exist)

Status: The problem remains unresolved. The standard Shopify inventory settings don’t address shared inventory pools across variants, suggesting a custom code solution may be needed.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Is there a code for shopify to prevent customer to from buying more than what is available in inventory. I have 2 variants, 2 pendants and 5 necklaces . Once all the pendants are added to cart , I need the add button to display sold out even when there are necklaces left.

My site

https://tigrisjewelryco.com/products/cubic-zirconia-cross-376183305

I only have 2 yellow brass in my inventory, If customer add 2 yellow brass with necklace 14in into cart , I need the add button to gray or or something so they cannot continue to add 2 yellow brass with necklace 16in.

Hi @tigrisjewelryco
To prevent customers from purchasing more than the available stock on Shopify, you can follow these steps:
Go to your Shopify admin panel, navigate to Products > All Products, select the product with variants (pendants and necklaces), ensure “Track quantity” is checked in the Inventory section, and uncheck “Continue selling when out of stock” and click Save button

Hello June ,

I have done that . If you go onto my link , you will still be able to add 2 yellow brass size 14 and 16 into cart (4 total yellow). I only have a total of 2 yellow brass in my inventory