WooCommerce Product Add Ons Ultimate allows you to use conditional logic to determine whether or not to display certain fields.
Setting up a condition
To create a condition, you’ll need at least two Product Add Ons fields – one field that will display or not depending on the status of the other field. In the example below, we’ve created a checkbox field and a text field. We only want the text field to display if the user has selected the checkbox field.
To create a condition, click the ‘Add Condition’ button under the field that you wish to apply the condition to. We only want to display the text field if the checkbox is selected, so we create a condition under the text field.
This opens up a new set of dropdown fields. In the first field, you can choose either:
- Hide this field if
- Show this field if
Choose whether you’d like to hide or show the field if the condition is true.
Then, choose from:
- All rules match
- Any rules match
This field is only relevant if you have more than one condition.
Finally, you define the condition:
- Choose which field will be checked as part of the condition – in our example, it’s ‘Checkbox Field’
- Choose between ‘Is’ and ‘Is not’
- Then define the value of the field that you’re testing
Conditions based on quantity
You can also set conditions based on the quantity of product. Instead of selecting a field, choose ‘Quantity’.