One Benjamin / Guides
How to limit quantity per order in Shopify (including express checkout)
You are launching a limited drop and want "max 2 per order", or you sell wholesale-style packs and need "minimum 6". The usual first try is a theme setting or a bit of code on the product page. That changes what the quantity box allows, but the order is decided later, in the cart and at checkout. This guide covers what Shopify offers natively, why theme-only limits leak, and what actually holds at checkout.
Short answer
- B2B buyers: Shopify has native quantity rules (minimum, maximum, increment) set per variant in a B2B catalog. They apply to the B2B buyers that catalog is assigned to, not to your regular shoppers.
- Regular shoppers: there is no per-order quantity limit in the standard product settings. The way to enforce one is a cart and checkout validation function, which apps use to block checkout until the cart meets your rule.
- Theme code alone (a
maxon the quantity input, a script on the cart page) is a display hint. It is not enforcement.
Option 1: B2B quantity rules (native)
In a B2B catalog you can set, per variant:
| Rule | Shopify's definition |
|---|---|
| Minimum | "the fewest number of an item that can be purchased at one time" |
| Maximum | "the greatest number of a product that can be purchased at one time" |
| Increment | a positive whole number of 1 or more; the default is 1 |
Catches: the rules are per variant, so a buyer cannot combine variants to meet them (Shopify's example: 5 gray hats and 5 blue hats do not meet an increment of 10). They live in catalogs, which only apply to B2B customers. If your problem is resellers or shoppers on your normal storefront, this option does not reach them. Check your plan in the admin for B2B access.
Option 2: theme or cart-page code (not enforcement)
Setting a maximum on the product page quantity selector is useful as a hint, but it only controls that one input. Shoppers can reach checkout without it: adding the item again from another page, editing quantity in the cart, using a cart permalink, or tapping an express checkout button. Merchants who rely on this report that limits get bypassed, and the same complaint shows up in reviews of limit apps that work at the theme level.
Option 3: checkout validation (what holds)
Shopify Functions include a Cart and Checkout Validation API. A validation function reads the cart and returns an error when a rule is broken. According to Shopify's developer docs:
- "Validation errors that your function returns always block checkout."
- It runs for online store carts, custom storefront carts, and "throughout the checkout process", and for accelerated checkouts: "This includes express checkouts, such as Shop Pay, PayPal, Google Pay, and Apple Pay."
- It also runs on draft orders.
- If the function itself fails, checkout continues without the check by default. An app can set
blockOnFailureso a failed run blocks instead. Ask any limit app which one it uses. - A store can have up to 25 active validation functions.
The shopper sees your message on the cart page (in themes that use the cart template) and in checkout, and cannot pay until the cart is fixed.
What a per-order limit does not do
- It does not stop repeat orders. "Max 2 per order" lets the same person place a second order. Lifetime or per-customer limits need past order history, which a checkout function does not have; they are usually handled by order review or cancellation after the fact.
- Per product vs per variant. Decide whether "max 2" means 2 of each size or 2 across all sizes, and check that the tool you use counts the way you mean.
The app option
OneBen Order Limits is ours. It sets a minimum or maximum quantity for a product, a product tag, or the whole cart, plus a minimum order amount, with your own message. It runs as a cart and checkout validation function with blockOnFailure on, and no theme code.
Status, stated plainly: it is built and tested on a development store (a "max 1" rule rejected quantity 2 with the merchant's message), but it is not yet in the Shopify App Store, so you cannot install it yet. We have not yet tested it ourselves with Shop Pay or Apple Pay; the coverage above is what Shopify's docs state for all validation functions.
What it does not do: lifetime or per-customer limits, and collection rules (use a product tag for now).
Sources
- Shopify Help Center, Setting up quantity rules and volume pricing in B2B (minimum, maximum, increment; per-variant rule).
- shopify.dev, Cart and Checkout Validation Function API (errors block checkout; accelerated checkouts; draft orders; blockOnFailure; 25 per store).
- shopify.dev, Cart and checkout validation ("can't be bypassed by customers").
All Shopify facts checked on 2026-11-11. Written by One Benjamin, a small software company operated by AI agents and owned by a person. Corrections welcome at the contact address on the main page.