Conditional Rules โ
The Visual Rule Builder lets you create logic that dynamically controls field behavior based on what the customer has already selected โ no code required.
Pro feature
Conditional Rules are available on the Pro plan only. Upgrade to unlock โ
What Are Rules? โ
A rule is an "if/then" statement that runs in real time on the storefront as customers interact with your fields.
Example: "If the customer selects 'Yes' in the 'Add Custom Embroidery?' field, then show the 'Custom Text' and 'Thread Color' fields."
Without rules, all fields are always visible. Rules give you a way to build progressive, context-aware forms โ only showing relevant options based on prior selections.
How Rules Work โ
Each rule has:
- Conditions โ One or more field-value pairs that must be true. You can require all conditions to match (AND logic) or any one of them (OR logic).
- Target Field โ The field that the rule acts on.
- Action โ What happens to the target field when conditions are met.
Available Actions โ
| Action | Effect |
|---|---|
| Show | Makes a hidden field visible. |
| Hide | Hides a visible field (and clears its value). |
| Require | Makes the field required when conditions are met. |
| Set Options | Replaces the field's option list with a new set of values. |
| Set Price Adjustments | Replaces the field's price adjustment map dynamically. |
Creating a Rule โ
- Open the Template Editor and click the Rules tab.
- Click + Add Rule.
- Under Conditions, select a field and the value it must equal.
- Click + Add Condition to add more conditions if needed. Toggle All / Any to control whether conditions are AND'd or OR'd.
- Under Then, select the Target Field and the Action.
- Click Save Template.
Changes take effect immediately on the storefront โ no cache to clear.
Rule Ordering โ
Rules are evaluated in the order they appear. Drag the โก handle to reorder rules. If two rules target the same field, the last matching rule wins.
Practical Examples โ
Show a text field when an option is selected โ
If "Add Custom Name?" equals "Yes"
Then Show field "Custom Name"
Default state: "Custom Name" is hidden. It only appears when the customer selects "Yes".
Swap dropdown options based on a prior selection โ
If "Garment Type" equals "Youth"
Then Set Options on "Size" = ["YXS", "YS", "YM", "YL", "YXL"]
This replaces the adult size list with youth sizes dynamically.
Require a field conditionally โ
If "Rush Order?" equals "Yes"
Then Require field "Ship-By Date"
The date field becomes required only when the customer opts for rush processing.
Tips & Best Practices โ
- Hide by default, show on condition is the most common pattern. Start with fields hidden and use "Show" rules to reveal them.
- Keep conditions simple. Complex multi-condition rules are harder to debug. Break them into multiple simpler rules when possible.
- Rules run client-side in real time. There is no server round-trip โ changes to field visibility are instant.
- Rules only control field visibility and options. Validation (required fields) is still enforced at add-to-cart time.
