To set a Shopify limit quantity per item, create a checkout rule that stops an order when any cart line exceeds your cap. Customers see your message in Shopify checkout and can lower the quantity before continuing.
Before you start
You need an active BlockCart subscription to save a rule. Choose the most units you want to allow on each cart line. This is a per-order limit, not a lifetime limit for a customer.
How to limit quantity on Shopify
- From the BlockCart home page, select Create new rule, then Cart and checkout validation.
- Enter a Rule name, such as “Maximum 5 per line.” Choose Standard input for Rule input.
- Under Eligibility, select Only when conditions match. Add Cart items quantity per line is greater than
5. Five units on a line are allowed; six or more match the rule. - Under Display, enter an Error message, such as “An item in your cart has more than 5 units. Reduce its quantity to continue.”
- Set Status to Live and select Save. Test a cart with six units on one line in Shopify checkout.

Example
| Rule input | Conditions | Error message | | -------------- | ---------------------------------------------- | ---------------------------------------------------------------------------- | | Standard input | Cart items quantity per line is greater than 5 | An item in your cart has more than 5 units. Reduce its quantity to continue. |
Good to know
- The condition checks every cart line. If any line exceeds five, the rule matches. It does not select one product. Adding Cart contains in the same condition group does not isolate that product: one line could contain the selected product while another exceeds the cap.
- If a product appears on separate lines, such as different variants, each line is checked separately. Their quantities are not added together for this condition. For a whole-cart cap, see Set a maximum quantity or order value.
- Shopify limit purchase quantity rules made this way apply to each order. BlockCart does not count past orders, so a customer can place another order. Rule input is locked after the rule is created.
