What is a metafield?
A metafield is an extra field in Shopify where you can save additional information for a product. For Product bulk limit, one product metafield stores both the quantity value and the quantity-rule type, written as JSON text.
Example: {"value":3,"type":"min_quantity"} means the customer must buy at least 3 of that product.
Why use Product bulk limit?
This is useful when you have many products and do not want to select them one by one in Nex Validator. You can store a different quantity rule on each product, and Nex Validator can use those values automatically.
Before you start
Make sure:
- Your Nex Validator plan includes Product bulk limit (Premium).
- You know which products need quantity rules.
- You know whether each product needs a minimum, maximum, or fixed multiple.
- The Nex Validator app embed is enabled if you also want supported product-page quantity controls to follow the rule — see install.
The three rule types
| Type | Use it when | Example |
|---|---|---|
multiple_of | The product must be ordered in fixed steps | {"value":3,"type":"multiple_of"} → customers can order 3, 6, 9, 12… |
min_quantity | The customer must buy at least a certain quantity | {"value":3,"type":"min_quantity"} → 2 is blocked; 3 or more is allowed |
max_quantity | The customer cannot buy more than a certain quantity | {"value":3,"type":"max_quantity"} → 3 is allowed; 4 or more is blocked |
Steps
1. Install Nex Validator
If Nex Validator is not installed yet, install it from the Shopify App Store and approve the required permissions. If it is already installed, skip to the next step.
2. Set the product metafield.
First, create the product metafield definition in Shopify. Go to Shopify admin → Settings → Custom data → Products → Add definition and use these exact details:
| Field | Value |
|---|---|
| Name | Checkout Rule |
| Namespace and key | checkout_ninja.rule |
| Type | Multi-line text |
| Value setting | One value |
If Shopify says the namespace and key are already taken, do not create another definition. Open the existing Checkout Rule metafield definition instead.
Next, open the product you want to control. Under Product metafields, find Checkout Rule and enter the JSON value for the rule you need:
| Rule | JSON value |
|---|---|
| Minimum quantity of 3 | {"value":3,"type":"min_quantity"} |
| Maximum quantity of 3 | {"value":3,"type":"max_quantity"} |
| Multiple of 3 | {"value":3,"type":"multiple_of"} |
The number can be different for each product. Keep the JSON structure and type name exactly as shown.
3. Open Nex Validator and create or edit the relevant rule. Turn on Allow bulk limit so Nex Validator can use the quantity values stored on your products.
4. Turn the rule on, then click Save.
Verify it worked
Test the rule using the exact JSON value entered on the product.
| JSON value | Quantity | Result |
|---|---|---|
{"value":3,"type":"multiple_of"} | 2 | Blocked |
| 3 or 6 | Allowed | |
{"value":3,"type":"min_quantity"} | 2 | Blocked, and the cart validation message is shown |
| 3 or more | Allowed | |
{"value":3,"type":"max_quantity"} | 2 or 3 | Allowed |
| 4 or more | Blocked, and the cart validation message is shown |
Also test:
- The cart page with a quantity below the minimum.
- The cart page with a quantity above the maximum.
- Checkout with an invalid quantity.
- A product that does not have a Checkout Rule metafield value — it should behave normally.
Common setups
| Goal | What to enter in Checkout Rule |
|---|---|
| Sell only in packs of 12 | {"value":12,"type":"multiple_of"} |
| Require at least 10 of a wholesale product | {"value":10,"type":"min_quantity"} |
| Allow a maximum of 2 of a limited product | {"value":2,"type":"max_quantity"} |
| Different products need different limits | Enter the required JSON value on each product |