- Shopify has no setting for "no more than N items in this cart". Not on Basic, not on Plus.
- Ten products at a maximum of 2 each is still 20 items, and every one of them is legal.
- HardLimits counts the whole cart and refuses the checkout above your number.
What Shopify does natively
Shopify's quantity rules are per variant: a minimum, a maximum and an increment, set in Markets → Catalogs and applied through B2B company profiles. That covers "two of this size".
It does not cover the cart. There is no admin field, on any plan, for the total number of units in an order. Checkout Blocks — Shopify's own free app — sets an order value limit, not a quantity limit, and its checkout features are Plus-only anyway.
So the cart total is the one number Shopify leaves entirely to the theme.
| You want | Native | Needs an app |
|---|---|---|
| At most 2 of one size | Yes, via a B2B catalog | No |
| At most 5 samples, whatever the mix | No | Yes |
| At most 12 items in the order | No | Yes |
| A message that says why | No | Yes |
Who actually needs this
- Sample and tester limits. Five samples per order, whatever the mix. A per-variant cap cannot express "five in total".
- Limited drops. One cart per person, not one of each product. This is the difference between a fair drop and a reseller with a bot.
- Shipping and packing. A hard ceiling on units per parcel, so a single order cannot overflow the box you actually stock.
- Wholesale and trade. A ceiling that keeps pallet-sized baskets out of a retail storefront.
Why a theme script is not enough
The usual DIY answer is a snippet in your theme that disables the checkout button when the cart is too big. It looks like it works, and then it doesn't.
The buyer controls the request. Changing the quantity in the cart, or opening a checkout permalink directly, skips whatever your theme drew on the page. There is no screen for the rule to run on. The check has to happen where the order is created — inside checkout — and a theme cannot do that.
How a cart-wide cap works
HardLimits adds a rule called maximum items per order. Shopify's checkout validation adds up the quantities on every line, ignores which products they are, and refuses the order above your number.
- Install, and choose Maximum items per order.
- Enter the number — 12, or 5, or 1 for a strict one-item drop.
- Write the message buyers see.
{q}inserts the number.
It runs at cart update and again when payment is attempted, so editing the cart is not a way around it. Nothing is added to your theme, and uninstalling leaves nothing behind.
The mistake that makes it look broken
Setting a per-variant maximum and calling it a cart limit. Ten variants at 2 each still allows 20 items, and every one of those lines is valid under the variant rule. If the number that matters is the total, the rule has to count the cart — not the product, and not the variant.
Two rules can coexist: a per-product cap of 2 and a cart cap of 12. The first stops a single item being hoarded, the second stops a hundred small ones. The paid plan exists mostly for this.
Test it in a minute
- Put exactly the cap in the cart and open checkout. It should load.
- Add one more item — any product. The cart should refuse the update.
- Open
/checkoutdirectly in a new tab. It should still be refused.
Step 3 is the one that separates a checkout rule from a theme hack.
What it deliberately does not do
No per-customer limits, no per-collection rules, no weight limits, no time windows, no repurchase caps. If you need those, a rule builder is the better buy — the comparison names which ones cover what. One app, four limits, done properly is the whole pitch.
Does it count units or line items?
Units. Three of one product is three, not one line. A cart of 4 items across 2 lines counts as 4.
Can I set a different cap for wholesale customers?
Not with this app — there is no customer-tag targeting. If that is the requirement, Melon or Blockify cover it and the comparison page says so.
What happens to a cart that is already over the limit?
Checkout is refused until the buyer removes something. The message tells them the number, so most people fix it themselves in a few seconds.
Cap the cart in one minute.
One limit is free, no card. Unlimited limits are $9.99 a month on any Shopify plan.