Setting the composition rules
At a glance
- What you get
- Decide exactly how the customer can build the box.
- Time
- 5 minutes
- Plan
- All plans
Before you start
You are creating a box (see Creating a box) or editing one from its page (see Managing existing boxes). The rules are in the Composition rules section of a new box, or Rules on the page of an existing box.
The three main fields
| Field | What it decides | Starting value |
|---|---|---|
| Minimum items | The least number of items the customer must choose. Must be 1 or more. | 3 |
| Maximum items | The most items they can choose. Must be equal to or higher than the minimum. | 3 |
| Max per variant | How many times they can choose the same product (the same variant). Must be 1 or more. | 1 |
Examples:
- “Choose exactly 3 different products”: minimum 3, maximum 3, max per variant 1.
- “Choose 4 to 6 products, repeats allowed”: minimum 4, maximum 6, max per variant 6.
- “Choose 5 products, at most 2 of the same”: minimum 5, maximum 5, max per variant 2.
Set the rules
- In Minimum items, type the minimum.
- In Maximum items, type the maximum. For an exact number, type the same value as the minimum.
-
In Max per variant, type how many times the same product can repeat.
What you’ll see: the Builder preview in the Appearance section immediately shows “3 items” or “3–5 items”, together with the price.
- Save: Create as draft for a new box, Save changes for an existing one.
Warning: the minimum must be reachable. If the box only uses hand-picked variants, the app checks that “number of variants × max per variant” is not below the minimum. With 2 variants and max per variant 1, for example, a minimum of 3 can never be completed: the app tells you and does not save.
Collection rules (optional)
When you use one or more collections as a source, you can ask the customer for a minimum and maximum number of items from each. For example: “at least 1 and at most 2 from the Creams collection”.
- On the collection card, type a number in Min from this collection. You can type 0 if you don’t want a minimum.
- Type a number in Max from this collection. It must be 1 or more and not below the minimum.
- Repeat for the other collections you care about. You can have rules on up to 8 collections.
- Leave both fields empty on collections without a rule.
Note: if you fill only one of the two fields of a collection, the app shows “Use at most 8 rules with valid min/max on the selected collections.” and does not save. Fill both, or empty both.
Who checks the rules
The rules are checked twice:
- In the store builder: the customer cannot add an incomplete box to the cart. The button says what is missing, for example “Choose 2 more” or “Complete the categories”.
- In the cart: Shopify checks every box again against the rules you saved. An invalid combination, even one made by editing the cart by hand, is refused and the box does not go into the cart.
Troubleshooting
“The maximum must be equal to or greater than the minimum.” appears. You typed a maximum below the minimum. Correct one of the two.
“The minimum is higher than what a customer can pick with these variants” appears. Add variants, raise Max per variant or lower the minimum.
A collection rule is not accepted. Make sure you filled both the minimum and the maximum and that the maximum is not below the minimum.