Conditional Logic
Conditional Logic
Conditional logic shows or hides fields and groups dynamically based on what the customer has already selected. Build smart, context-aware product forms without writing code.
How conditional logic works
Each field and each group can have one or more conditional rules. When the conditions are met, the field or group is shown; otherwise it is hidden. Hidden fields do not add to the price and are not required.
Rules are evaluated in real-time as the customer interacts with the form — no page reload required.
Setting field conditions
- Open a field in the group editor.
- Scroll to the Conditional Logic section.
- Click Add Rule.
- Select the trigger field (any other field in the same group).
- Select the operator:
is,is not,contains,is checked,is not checked. - Enter or select the trigger value.
- Set whether all rules must match, or any rule must match.
Operators by field type
| Field type | Available operators |
|---|---|
| Checkbox | is checked, is not checked |
| Radio, Dropdown, Image Select | is (option value), is not (option value) |
| Checkbox Group | contains (option value), does not contain (option value) |
| Text, Textarea | is, is not, contains, does not contain, is empty, is not empty |
| Date | is, is before, is after |
| Custom Price | is greater than, is less than, is equal to |
Group-level conditions
You can also add conditional rules to an entire group, not just individual fields. This hides or shows the whole group based on a WooCommerce product attribute or a field in another group.
Group conditions are set from the group editor under Group Conditions. Note: cross-group conditions only work if both groups are assigned to the same product.
Example: Gift wrap + message
- Field 1: Checkbox — "Add gift wrapping (+£3)"
- Field 2: Text — "Gift message"
- Rule on Field 2: Show when “Add gift wrapping” is checked
Result: The gift message input only appears after the customer checks the gift wrap checkbox. If they uncheck it, the message field disappears and the price update reverses.
Example: Material → finish options
- Field 1: Radio — "Material" (options: Wood, Metal, Acrylic)
- Field 2: Dropdown — "Wood finish" (options: Oak, Walnut, Pine)
- Field 3: Dropdown — "Metal finish" (options: Brushed, Polished, Matte)
- Rule on Field 2: Show when “Material” is “Wood”
- Rule on Field 3: Show when “Material” is “Metal”
Result: Only the relevant finish options appear, keeping the form clean and easy to use.
Validation and conditional fields
If a field is hidden by a conditional rule, it is automatically excluded from required-field validation. You do not need to manage this manually.