How to require a minimum quantity across mixed Shopify products and variants
Short answer: Require at least 5 units across all products tagged moq-5, allowing shoppers to mix products and variants in one qualifying order. In Checkpost, choose “Mix-and-match minimum across products” from Templates, adjust the values, test it, then save and enable the rule.
The problem
A pin seller asked for a minimum while letting shoppers choose several colours. A per-line minimum rejects valid mixed orders; a whole-cart minimum counts unrelated products. This preset counts only the eligible set, including separate products and variants.
Related merchant discussion on Shopify Community
How to set it up
- Install Checkpost from the Shopify App Store.
- Open Templates and choose Mix-and-match minimum across products.
- Tag the eligible products, then set the combined minimum. Use the per-product MOQ template if each product must meet its own minimum.
- 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:
- Combined quantity of products (products tagged moq-5) is less than 5
Shoppers see: “Choose at least 5 qualifying items. You can mix products and colours.” at the top of checkout, in the cart and at checkout.
Rule definition (JSON)
{
"name": "Mix any 5 qualifying items",
"match": "all",
"conditions": [
{
"kind": "line_number",
"field": "matching_quantity",
"op": "lt",
"value": 5,
"filter": {
"productTags": [
"moq-5"
]
}
}
],
"message": "Choose at least 5 qualifying items. You can mix products and colours.",
"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 pins + 3 pink pins tagged moq-5 | Allowed by this rule |
| 2 eligible pins + 10 untagged postcards | 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
- Tag every eligible product moq-5. Untagged items never help meet this minimum.
- Set the threshold to 4 for the pin seller's example, or keep 5 for the preset below.
- Keep one policy for the set: enabling a separate per-product MOQ would also require every product to meet that other rule.
Can you do this without an app?
A bundle or quantity-selector app can help customers choose several colours. Checkpost supplies checkout enforcement; it does not add a mixed-variant selector to the product page.
FAQ
Do two units of one colour plus three of another meet the minimum?
Yes. With the default threshold of 5, all moq-5 units are added together, even if the colours belong to separate eligible products.
Will an order without eligible products be blocked?
No. This rule applies only when at least one qualifying product is present.
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.