Per-Customer Purchase Limit Override

issue date: 2026-5-15

You can override the maximum purchase quantity (set in the group settings of Customer Quantity Limit Per Product) for specific customers individually.

This is useful for use cases such as raising the limit for VIP customers, applying a different limit for wholesale accounts, or imposing a stricter limit on certain customers.

Prerequisites

  • Set up the group (target products and maximum purchase quantity) in Customer Quantity Limit Per Product first.
  • The variant you want to override must be included as a target product of that group.

How It Works

Normally, the maximum quantity set in a group is applied uniformly to all customers who purchase the target products. With this feature, by adding a lo (limit override) entry to an individual customer's metafield, a different limit can be applied to that customer only.

  • Only when a variant registered in lo is being evaluated, the group's maximum quantity is overridden.
  • Customers with no lo configured, or whose target variant is not in their lo, are evaluated using the group's original setting.
  • The existing purchase history (v) is preserved — lo coexists in the same metafield.

Setup Instructions

1. Open the target customer's metafield

In the Shopify admin, open the target customer and locate the following metafield:

namespace: cc-order-rule-purchase-products
key: cc-order-rule-purchase-products-key

2. Get the variant ID

Open the target product variant in the Shopify admin and extract the numeric ID from the end of the URL.

Example: https://admin.shopify.com/store/<store>/products/<product-id>/variants/46761447063741
→ The variant ID is 46761447063741.

3. Add the lo field to the JSON

Add a lo array to the metafield's JSON value. Keep the existing v (purchase history) array intact.

When the value is empty or contains only v

{
  "v": [],
  "lo": [
    { "variantId": 46761447063741, "max": 11 }
  ]
}

Overriding multiple variants

{
  "v": [],
  "lo": [
    { "variantId": 46761447063741, "max": 11 },
    { "variantId": 46761447063742, "max": 3 }
  ]
}

4. Save

Once the metafield is saved, the customer's purchase attempts (on the product page and at cart/checkout) will be evaluated against the overridden limit. Display messages such as "Up to N per customer" will also reflect the overridden value.

Field Reference

Field Type Description
variantId Number (string also accepted) The variant ID to override
max Number The new maximum purchase quantity. Can be larger or smaller than the group's setting

Notes

  • Do not break the JSON syntax: Missing commas or quotes may corrupt the customer's entire purchase history data. Verify the syntax before saving.
  • Do not delete the v field: The existing purchase history is stored in the same JSON. Be careful not to remove v when adding lo.
  • Duplicate variantId entries: If the same variantId is registered multiple times, the first matching entry in the array is used. Avoid duplicates.
  • Variants outside the group: Setting lo for a variant that is not part of the group's target products has no effect.
  • No admin UI is provided: If you need to automatically set lo based on customer tags or purchase history, you will need a custom implementation using Shopify Flow or Webhooks.

Where the Override Applies

The lo setting is reflected in both of the following at the same time:

  • Product page display: Messages such as "Up to N per customer" or "You can buy N more"
  • Cart and checkout validation: Quantity checks performed by the Shopify Function

Support

For implementation questions, please contact support at [email protected]. Paid support is also available as needed (for example, if you want to use Shopify Flow to link this limit with the purchase quantity of other products).

How to set
Order Limits
Pre-order
Find by what you want to do
FAQ
cc-logo
Shopify Apps that developed by Capital Castle