RuffRuff Order Limits

thumbnail

(Use Case) Set Wholesale Order Multiples Using a Customer Metafield

Use a customer metafield to separate large and regular wholesale customers and set a minimum quantity and order multiple for each group.

This example uses a customer type stored in a customer metafield to let large wholesale customers purchase a minimum of 24 items in multiples of 12, and regular wholesale customers a minimum of 6 items in multiples of 6. Other members and guests can purchase starting from 1 item.

Use the Full plan and prepare customer accounts and eligible items for testing. In this example, the quantity a customer can purchase in a single order is limited for each eligible variant.

Customer

Customer type value and login status

Quantity they can purchase

Large wholesale

wholesale_large and logged in

24, 36, 48 items, and so on

Regular wholesale

wholesale and logged in

6, 12, 18 items, and so on

Other members

Any other value or blank, and logged in

1 or more items, in increments of 1

Guest

Not logged in

1 or more items, in increments of 1

(1) Add a definition

In the Shopify admin, open a customer. Under Metafields, select "Add definition," then create and save the following customer metafield.

Setting

Example

Name

Customer type

Namespace and key

custom.customer_type

Type

Single line text (single value)

Shopify Help: Creating custom metafield definitions

(2) Add a value for each customer

Enter wholesale_large in "Customer type" for large wholesale customers and wholesale for regular wholesale customers, then save. After saving, confirm each customer's value.

Shopify Help: Adding values to metafields

(1) Create a rule

In the app admin, go to "Quantity limits" → "Quantity rules by customer group" → "Create rule," then enter "Wholesale order multiples" as the rule name.

(2) Specify the metafield to use

Under "Group condition," select "Customer metafield," enter custom for the namespace, and enter customer_type for the key.

(3) Add the additional groups

Select "Add group" and add the following two groups.

Group name

Metafield value

Large wholesale

wholesale_large

Regular wholesale

wholesale

Metafield values are matched exactly. Differences in capitalization or leading or trailing spaces prevent a match. Even if a customer type is set, the guest limits apply when the customer is not logged in.

(4) Set the quantity for each group

Set all groups to "Limit" and enter the following values. Leave the maximum quantity blank for every group.

Group

Minimum quantity

Increment

Large wholesale

24

12

Regular wholesale

6

6

Member

1

1

Guest

1

1

(5) Set the applicability and eligible items

Set "Applicability" to "Variant" and select the eligible items. Arrange the additional groups with Large wholesale first and Regular wholesale second.

(6) Review the messages and enable the rule

Review the alert messages for the minimum quantity and increment, save the settings, then select "Enable" on the details page.

  • Log in as a large wholesale customer and confirm that quantities of 24 and 36 meet the limit, that a quantity of 12 triggers the minimum quantity alert, and that a quantity of 25 triggers the increment alert.

  • Log in as a regular wholesale customer and confirm that quantities of 6 and 12 meet the limit, and that quantities of 1 and 7 trigger an alert.

  • Confirm that a quantity of 1 meets the limit for a logged-in member whose customer type is blank or has another value, and for a guest who is not logged in.

Test the rule in the cart or at checkout according to the display timing. If you also use other quantity rules, their conditions must also be met.