RuffRuff Order Limits

(Use Case) Limit Cart Total Quantity to Multiples of 4

An example that allows customers to buy the total number of stems for eligible items, across the whole cart, only in multiples of 4.

An example that allows customers to buy the total number of stems for eligible items, across the whole cart, only in multiples of 4. Use this when selling products such as bouquets, where the number of stems matters, in fixed units. Customers can still select from 1 stem on the product page, but an order is only accepted when the total is a multiple of 4.

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] Flowers — Multiples of 4 Only.

When you enable the quantity rule, it evaluates the total number of stems for the eligible items in the cart at checkout. Even if the products or variants differ, the stem counts for the eligible items are added together. Items that are not eligible are not included in the total.

  • Total stems of eligible items is a multiple of 4 (4, 8, 12 stems, etc.): purchase is allowed.

  • Total stems of eligible items is not a multiple of 4 (1, 2, 3, 5 stems, etc.): purchase is not allowed.

The following is an example with red roses and white roses as the eligible items.

Cart contents

Total

Result

Red roses × 4

4 stems

Allowed

Red roses × 2 + White roses × 2

4 stems

Allowed

Red roses × 3 + White roses × 2

5 stems

Not allowed

Red roses × 6 + White roses × 2

8 stems

Allowed

(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

4

Maximum quantity

Not set

Increment

4

Applicability

Cart

Eligible items

Products sold by stem count (e.g., flowers for bouquets)

Product message

Enter if needed

Display timing

Checkout only

Message for minimum order quantity

Enter if needed

Message for increment of 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 so the total is 4 stems and then 5 stems, and check the result at checkout.

  • If you set applicability to "Cart," the minimum quantity and increment are not reflected in the quantity picker on the product page. Even with the app embed enabled, customers can still select from 1 stem.

  • If you set display timing to "Checkout only," customers can add any number of stems to the cart, and the total is evaluated at checkout. If you set it to "Cart updated and checkout," any cart update that would make the total not a multiple of 4 is blocked, so customers cannot add stems one at a time to adjust the total.

  • You can use {{increment}} in the message for increment of order quantity.

  • To make only the stem count of the same product a multiple of 4, set applicability to "Product."