This example limits the same variant to 3 per order. Different variants are not combined, so you can purchase up to 3 of each.
Prerequisite: The initial setup for Quantity limits must be complete. If you haven't done this yet, see "Initial Setup (Product Quantity Limits)".
You can check the behavior after setup in [Demo] Quantity Limit of 3 Per Variant.
When the quantity rule is enabled, it evaluates the total quantity of the same variant in the cart.
Total quantity of the same variant is 3 or less: purchase is allowed.
Total quantity of the same variant is 4 or more: purchase is not allowed.
Here is an example of adding one product with S and M variants to the cart.
Cart contents | Result | Reason |
|---|---|---|
S size × 3 | Allowed | S size is 3 or less |
S size × 3 + M size × 3 | Allowed | Each variant is 3 or less |
S size × 4 | Not allowed | S size exceeds 3 |
S size × 3 + M size × 4 | Not allowed | M size exceeds 3 |
(1) Add a quantity rule
Open the app admin → "Quantity limits" → "Quantity rules" → "Add quantity rule".
(2) Enter the settings
Configure the following.
Field | Value |
|---|---|
Title | Any internal title |
Minimum quantity | 1 |
Maximum quantity | 3 |
Increment | Not set |
Applicability | Variant |
Eligible items | Products or variants to restrict |
Product message | Enter if needed |
Display timing | Cart updated and checkout |
Message for maximum order quantity | Enter if needed |
(3) Save and enable the quantity rule
After saving the settings, select "Enable." Saving alone does not apply the quantity limit.
(4) Check the behavior
Add the eligible items to the cart in the quantities above, and check the result when the cart is updated and at checkout.
To limit the total across all variants, set Applicability to "Product."
You can use
{{maxQuantity}}in the message for maximum order quantity.