How to limit each Shopify variant across split cart lines
Short answer: Cap each limited-tagged variant at 2 units per order, adding together duplicate lines with different customisations instead of capping the whole product. In Checkpost, choose “Maximum quantity per variant” from Templates, adjust the values, test it, then save and enable the rule.
The problem
Personalisation can split one variant into several cart lines. A per-line cap of two then allows two on every row. A variant cap sums those rows while allowing different sizes or colours their own allowance.
Related merchant discussion on Shopify Community
How to set it up
- Install Checkpost from the Shopify App Store.
- Open Templates and choose Maximum quantity per variant.
- Choose the products or variants and maximum. Use the per-product limit if different sizes and colours must share one cap.
- Use Try this rule to test a sample cart, then click Save rule.
The rule
Checkout is blocked when all of these conditions is true:
- Quantity per variant across cart lines (products tagged limited) is greater than 2
Shoppers see: “You can order up to 2 of each limited variant, including personalised copies.” at the top of checkout, in the cart and at checkout.
Rule definition (JSON)
{
"name": "Max 2 of each limited variant",
"match": "all",
"conditions": [
{
"kind": "line_number",
"field": "variant_quantity",
"op": "gt",
"value": 2,
"filter": {
"productTags": [
"limited"
]
}
}
],
"message": "You can order up to 2 of each limited variant, including personalised copies.",
"target": "cart",
"runOn": "always"
}Examples with the default settings
These outcomes apply to this rule alone. Other enabled rules may also affect checkout.
| Test cart | Expected outcome |
|---|---|
| 2 blue + 2 red of a limited product | Allowed by this rule |
| Same limited variant on two lines: 2 + 1 | Checkout blocked |
Where this rule works
These are cart and checkout validations, including supported accelerated checkouts. They are current-cart policies; they do not track previous purchases of a SKU. Shopify excludes POS, recurring subscription orders and native pre-order/Try Before You Buy flows from this API. See Shopify's validation compatibility.
Tips
- Choose the per-product cap when all sizes and colours must share one allowance.
- In the simulator's product details, give split rows the same variant identity. Give different colours different identities.
- This is an order limit, not an order-history or household limit. It does not prevent a second order or a guest using another account.
FAQ
Can a customer buy two blue and two red?
Yes, when blue and red are distinct variants and the limit is two per variant. A product-wide limit would count all four together.
Can engraving or gift-wrap properties bypass the cap?
Changing line-item properties may split rows, but rows with the same Shopify variant ID still count together.
Related rules
Maximum quantity per product
Cap the quantity of a product per order — perfect for limited drops, launches and high-demand items that resellers target.
Minimum order quantity (MOQ) per product
Require a minimum quantity for selected products, so low-margin or bulk items can't be ordered in single units.
Sell in case packs / multiples
Only allow quantities in multiples of a pack size — e.g. 6, 12 or 24 — for case-packed goods like wine, beverages or wholesale stock.
Maximum items per order
Cap the total number of units per order — useful when packaging, couriers or inventory can't handle oversized orders.