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.
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
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.
Recommended testing workflow
Before you rely on cart error handling for live orders, test one product from start to finish.
- Open the product page on your storefront.
- Enter a quantity below your Minimum Quantities rule or above your Maximum Quantities rule.
- Try to add the product using the invalid quantity.
- Confirm your Custom validation message appears.
- Change the quantity to a valid amount and confirm the shopper can continue normally.
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.