An example that limits the total weight of eligible items in the cart to 5kg or less. Even if the products or variants differ, the weights of the eligible items are added together for the evaluation.
Prerequisite: The initial setup for weight limits must be complete. If you haven't done this yet, see "Initial Setup (Weight Limits)".
When you enable the weight rule, it evaluates the total weight of the eligible items in the cart across products and variants. Items that are not eligible are not included in the total. The total weight is calculated by multiplying each variant's weight registered in Shopify by its quantity.
Total weight of eligible items in the cart is 5kg or less: purchase is allowed.
Total weight of eligible items in the cart is more than 5kg: purchase is not allowed.
Note: Variants without a weight set are not included in the total and are not subject to the limit.
(1) Create a weight rule
Open the app admin → "Weight limits" → "Weight rules" → "Create rule".
(2) Enter the settings
Configure the following.
Field | Value |
|---|---|
Title | Any internal title |
Minimum weight | Not set |
Maximum weight | 5 |
Weight unit | Kilograms (kg) |
When product weight unit differs | Convert and include in calculation |
Applicability | Cart |
Eligible items | Products to limit by weight |
Product message | Enter if needed |
Display timing | Cart updated and checkout |
Message for maximum weight | Enter if needed |
(3) Save and enable the weight rule
After saving the settings, select "Enable." Saving alone does not apply the weight limit.
(4) Check the behavior
Add combinations of eligible items to the cart that total 5kg and that exceed 5kg, and check the result when the cart is updated and at checkout.
If you set applicability to "Cart," different products and variants among the eligible items are added together. To evaluate by product or by variant, set applicability to "Product" or "Variant."
You can use
{{maxWeight}}and{{currentWeight}}in the message for maximum weight. They are replaced with the value including its unit, such as "5kg," and the current total weight, respectively.If you set "When product weight unit differs" to "Convert and include in calculation," the evaluation converts weights to the rule's unit even when g, kg, oz, and lb are mixed. If you set it to "Exclude from calculation," variants with a different unit than the rule are not included in the total.