Custom Rules
Block orders that don't meet your requirements by creating custom validation rules. Set conditions based on cart value, product quantity, or specific products β and display clear error messages at checkout.
Available on all Shopify plans. Custom Rules uses Shopify Functions β no Shopify Plus required.
What it does
Custom Rules lets you create validation rules that block checkout when specific conditions are met:
Cart total β require a minimum or maximum order value
Cart quantity β limit the total number of items
Product quantity β restrict how many of a specific product can be ordered
Product restrictions β block checkout when certain products are (or aren't) in the cart
Each rule shows a custom error message at a position you choose β either as a banner at the top of the page or inline next to a specific field.
Step 1: Go to Checkout Validations
In the app sidebar, click Checkout Validations. You'll see the list of all validation rules.
List page overview
Search
Find rules by name
Status filter
Filter by Active, Inactive, or Test mode
Table
Shows rule name, status, conditions summary, and actions
Actions
Activate/Deactivate, Edit, Delete for each rule
Bulk actions
Select multiple rules to activate, deactivate, or delete
Step 2: Create a new rule
Click Create validation (top right). The editor opens with three sections: General Setting, Trigger Conditions, and Error Message.
Step 3: Set name and status
Rule name
A descriptive name for your reference (e.g., "Minimum order $50")
Status
Active β rule applies at checkout. Test mode β only triggers when checkout email is [email protected]. Inactive β rule is saved but not applied.
Tip: Start with Test mode to verify the rule works correctly before activating it for all customers.
Step 4: Configure trigger conditions
Trigger conditions define when the rule blocks checkout. By default, rules apply to all orders.
Two modes
No condition
Rule always applies to all orders
When conditions are met
Rule only applies when all conditions are satisfied (AND logic)
Available condition types
When you select When conditions are met, a condition builder appears. Click "+ Add 'AND' condition" to add rows.
Product
Contains / Does not contain
Cart contains "Fragile Item" β block checkout with warning
Product quantity
Greater than / Greater than or equal / Less than / Less than or equal
Product quantity > 10 β block bulk orders
Cart total
Greater than / Greater than or equal / Less than / Less than or equal
Cart total < $50 β require minimum order
Cart quantity
Greater than / Greater than or equal / Less than / Less than or equal
Cart quantity > 20 β limit total items
All conditions use AND logic β every condition must be true for the rule to trigger. For example: "Cart total < $50" AND "Cart contains Product A" means both must be satisfied for the error to show.
Step 5: Configure error message and position
This section controls what buyers see when the rule triggers.
Error message
Enter the message buyers will see at checkout. Keep it clear and helpful β explain what they need to do (e.g., "Your order must be at least $50 to proceed. Please add more items.").
Maximum 200 characters recommended. A character counter is shown below the field.
Error position
Choose where the error message appears on the checkout page:
Top of the checkout page
Red banner at the top of the page β most visible
First name
Inline error below the First name field
Last name
Inline error below the Last name field
Company
Inline error below the Company field
Address line 1
Inline error below Address line 1
Address line 2
Inline error below Address line 2
City
Inline error below the City field
Email or phone number
Inline error below the Email/Phone field
Delivery phone
Inline error below the Delivery phone field
ZIP / Postal code
Inline error below the ZIP code field
Country
Inline error below the Country dropdown
Province / State
Inline error below the Province/State dropdown
"Top of the checkout page" is recommended for most rules β it's the most visible position and doesn't confuse buyers into thinking a specific field has an error.
Step 6: Preview and save
The right sidebar shows a live preview of how your error message will appear based on the selected position.
Full checkout preview
Click "Preview in checkout" to open a full-screen modal showing the complete checkout layout with your error message rendered at the correct position.
When everything looks good:
Set the Status to your preferred option
Click Save in the top bar
The rule takes effect at checkout immediately.
Test your rule with Test Mode
Before activating a rule for all customers, test it first:
Set the rule Status to Test mode and save
Go to your store and add products to the cart
Proceed to checkout
Enter [email protected] as the checkout email
Make sure all trigger conditions (if any) are met
Verify the error message appears at the correct position
Once verified, change the status to Active
Test mode only works with the email [email protected]. All trigger conditions must also be satisfied for the rule to take effect.
Manage existing rules
Toggle status
Use the Pause / Start action on any rule to quickly toggle its status without opening the editor.
Edit a rule
Click the edit icon (pencil) in the Actions column, or click the rule name to open the editor.
Delete rules
Single rule: Click the delete icon (trash) in the Actions column
Bulk delete: Select multiple rules with checkboxes β click Delete rules
Other bulk actions: Activate rules, Deactivate rules.
Deletion is permanent. The rule cannot be recovered.
Tips
Start with Test mode β verify the rule works correctly before activating for all customers
Use "Top of the checkout page" for most rules β it's the most visible and avoids field-level confusion
Keep messages actionable β tell buyers what to do, not just what went wrong (e.g., "Add at least 2 items" instead of "Not enough items")
Combine conditions wisely β all conditions use AND logic, so the rule only triggers when every condition matches
Keep rule names descriptive β "Min order $50 for wholesale" is better than "Rule #1"
Check the limits β Shopify allows up to 25 active validation rules at once
FAQs
General
Q: Do I need Shopify Plus for Custom Rules? A: No. Custom Rules uses Shopify Functions, which are available on all Shopify plans.
Q: How many rules can I have? A: You can have up to 25 active validation rules at once (shared with Geo Restriction rules).
Q: Do rules take effect immediately after saving? A: Yes. Once a rule is set to Active and saved, it applies to all new checkouts immediately.
Trigger conditions
Q: What happens if I set no conditions? A: The rule applies to every order at checkout. The error message will always show.
Q: Can I combine multiple conditions? A: Yes. Add multiple conditions with AND logic β all must be true for the rule to trigger.
Q: Does "Product" condition check variants? A: It checks at the product level. If any variant of the selected product is in the cart, the condition is met.
Q: What's the difference between "Greater than" and "Greater than or equal"? A: "Greater than 10" means 11 or more. "Greater than or equal to 10" means 10 or more.
Error message
Q: Can I use different languages in the error message? A: Yes. Enter the message in any language you prefer β it will display exactly as typed.
Q: What happens if multiple rules trigger at the same time? A: All matching rules display their error messages. Buyers must resolve all errors before completing checkout.
Q: Does the error block checkout or just show a warning? A: The error blocks checkout β buyers cannot complete their purchase until the condition is no longer met.
Last updated