Checkout Enforcement
How MOQ Manager validates cart quantities at checkout, and how to customise error messages.
MOQ Manager enforces quantity rules via a Shopify Cart Validation Function — code that runs natively inside Shopify's checkout infrastructure, not on your store's servers. Customers cannot complete a purchase until every quantity constraint in their cart is satisfied.
How It Works#
- Customer clicks Checkout
- Shopify automatically runs the MOQ validation function
- The function reads your rules from your shop's metafield
- It checks every item in the cart against any applicable rules
- If a violation is found, checkout is blocked — the customer sees an error message and must fix their cart before continuing
- Once all quantities are valid, checkout proceeds normally
Because the function runs inside Shopify's infrastructure, it cannot be bypassed by workarounds on the storefront. Every order goes through the same check.
Customising Error Messages#
By default, MOQ Manager uses clear, plain-language error messages. You can customise all three message templates from MOQ Manager → Settings.
Available templates#
Minimum quantity violation:Minimum order quantity for {{product_name}} is {{moq_quantity}}. You have {{current_quantity}}.
Maximum quantity violation:
Maximum order quantity for {{product_name}} is {{max_quantity}}. You have {{current_quantity}}.
Step quantity violation:
"{{product_name}}" must be ordered in multiples of {{step_quantity}}. The nearest valid quantity is {{nearest_quantity}}.
Placeholder reference#
| Placeholder | What it inserts |
|---|---|
{{product_name}} | The product title |
{{moq_quantity}} | The minimum quantity required |
{{max_quantity}} | The maximum quantity allowed |
{{step_quantity}} | The step/multiple value |
{{nearest_quantity}} | The closest valid quantity above the customer's current amount |
{{current_quantity}} | The quantity the customer currently has in their cart |
You can omit placeholders if you prefer a simpler message. For example: "Please order this item in packs of ."
Checking the Validation Status#
The Settings page shows whether checkout validation is currently active. If it shows as inactive, click Activate to re-enable it.
If you ever need to pause all MOQ enforcement temporarily, go to Shopify → Settings → Checkout → Checkout rules and turn off the moq-validation rule. Turn it back on when you're ready to resume.
Custom Line Items (ACO / App Checkout)#
For line items added via App Checkout (ACO) or other third-party order customisation tools, MOQ Manager attempts to identify the underlying product via line item attributes. The following attribute keys are checked: _product_id, _source_product_id, _parent_id.
Checkout enforcement applies to standard online checkout only. Draft orders and Shopify POS are not subject to the same Cart Validation Function.
Was this helpful? If you have questions or something isn't working, contact support.