Cart Error Handler

What the cart error handler does

In QuantityLock, the cart error handler is the customer-facing behavior that stops shoppers from checking out with an invalid quantity. It works together with your product quantity limits and your Custom validation messages.

If a shopper tries to add too few items for a Minimum Quantities rule or too many items for a Maximum Quantities rule, QuantityLock blocks the invalid quantity and shows the message you configured.

The cart error handler is not a separate setup flow. It works when you have an active product quantity limit and a clear Custom validation message.

When shoppers see an error

Shoppers can see a QuantityLock error any time their selected quantity does not match your rules.

  • They add fewer items than required by a Minimum Quantities rule.
  • They add more items than allowed by a Maximum Quantities rule.
  • They try to continue with a quantity that breaks the limit you set for that product.

When this happens, QuantityLock keeps the invalid quantity from going through and displays your Custom validation message so the shopper knows how to fix it.

Set up cart error handling

In Shopify admin, go to Apps and select QuantityLock.Add a product quantity limit for the product you want to control. Use Minimum Quantities if shoppers must buy at least a set amount, or Maximum Quantities if you want to cap how many units they can buy.Write a Custom validation message that tells shoppers exactly what quantity is allowed. Keep the message direct so the shopper can correct the quantity without guessing.Open the product on your storefront and try a quantity that breaks the rule. Confirm that QuantityLock blocks the invalid quantity and shows your custom message.

How to write effective error messages

Your Custom validation messages should explain the rule in plain language.

  • For a minimum rule, tell shoppers the lowest allowed quantity.
  • For a maximum rule, tell shoppers the highest allowed quantity.
  • Avoid vague messages that only say the cart has an error.
  • Match the wording to the exact limit you configured.
The best validation messages tell shoppers what to do next, such as increasing or reducing the quantity to meet the rule.

Recommended testing workflow

Before you rely on cart error handling for live orders, test one product from start to finish.

  1. Open the product page on your storefront.
  2. Enter a quantity below your Minimum Quantities rule or above your Maximum Quantities rule.
  3. Try to add the product using the invalid quantity.
  4. Confirm your Custom validation message appears.
  5. Change the quantity to a valid amount and confirm the shopper can continue normally.
If you are on the Free Plan, you can still test this workflow using your included 1 x Product quantity limits rule.

Common reasons cart errors are confusing

Update your Custom validation message so it names the required minimum or allowed maximum quantity instead of showing a generic warning.

Make sure you are testing the exact product with the active product quantity limit. If another product has no rule, QuantityLock will not show the same error behavior.

After saving the rule in QuantityLock, always run a storefront test with an invalid quantity and then a valid quantity to confirm the shopper experience.

Start with one low-risk product, one simple quantity rule, and one clear validation message before expanding to more of your catalog.

Best practices

  • Use Minimum Quantities for packs, bundles, or wholesale ordering.
  • Use Maximum Quantities for limited inventory or anti-bulk-buying rules.
  • Keep Custom validation messages short and specific.
  • Test every new rule on the storefront before going live.
If your validation message does not clearly state the allowed quantity, shoppers may abandon the purchase instead of correcting the cart.

Related pages

Install QuantityLock from the Shopify App Store and open it from Apps in Shopify admin.Create your first product quantity limit, choose Minimum Quantities or Maximum Quantities, and test your Custom validation messages.