Checkpost

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

  1. Install Checkpost from the Shopify App Store.
  2. Open Templates and choose Maximum quantity per variant.
  3. Choose the products or variants and maximum. Use the per-product limit if different sizes and colours must share one cap.
  4. 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:

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 cartExpected outcome
2 blue + 2 red of a limited productAllowed by this rule
Same limited variant on two lines: 2 + 1Checkout 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

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

Add maximum quantity per variant to your store