To configure conditional logic rules, navigate to the Conditional Logic tab field you want to edit, and select one of the What to do? Available options.
You can choose from:
- no action,
- show this field,
- hide this field,
- set as required.
It allows setting conditions for the conditional logic rules. There are eight types of conditional logic configuration:
- WooCommerce default fields,
- Flexible Checkout Fields plugin fields,
- Flexible Products Fields plugin fields,
- cart,
- cart contains,
- user,
- shipping method,
- payment method,
- date.
Conditional logic can be set using actions, conditions, and triggers.
It is possible to create: groups and rules that define the conditions for displaying, hiding, or setting as required in any field in the WooCommerce checkout form.
Groups allow collecting any number of rules. If the logic conditions in each group are duplicated, they will be executed in order, from first to last.
If the logic conditions are mutually exclusive, the group added last will take precedence, overwriting the settings of the previously added group.
Contents
WooCommerce default fields conditional logic
Conditional logic allows any field to be displayed, hidden, or set as required, based on the field available in the billing, shipping, or order sections of the checkout form.
The billing sections fields, conditional logic can be set, are:
- Billing: First name,
- Billing: Last name,
- Billing: Company name,
- Billing: Country/Region,
- Billing: Street address,
- Billing: Apartment, suite, unit, etc.
- Billing: Postcode/ZIP,
- Billing: Town/City,
- Billing: State/County,
- Billing: Phone,
- Billing: Email address,
-
In the shipping section:
- Shipping: First name,
- Shipping: Last name,
- Shipping: Company name,
- Shipping: Country/Region,
- Shipping: Street address,
- Shipping: Apartment, suite, unit, etc.
- Shipping: Postcode/ZIP,
- Shipping: Town/City,
- Shipping: State/County.
And in order section:
- notes,
When the action is selected, one of the fields must be indicated and the condition is or is not. It is required to indicate the value which triggers the logical condition.
Flexible Checkout Fields plugin fields conditional logic
Conditional logic allows any field to be displayed, hidden, or set as required, based on the fields created in the plugin sections:
- checkbox,
- select,
- radio,
- radio with images,
- radio with colors,
When the action is selected, one of the fields must be indicated and the condition is or is not. It is required to indicate the option you have previously set.
Fields that have a single-choice option, select, checkbox, or radio will be the selection of a specific option, for the other fields checked or unchecked.
Flexible Product Fields plugin fields conditional logic
Conditional logic allows any field to be displayed, hidden, or set as required, based on the fields created in the Flexible Product Fields plugin:
These fields are as follows:
- checkbox,
- select,
- radio,
- radio with images,
- radio with colors.
The action will be executed if there is a product in the cart with a Flexible Product Fields plugin field used.
When the action is selected, one of the fields must be indicated and the condition is or is not. It is required to indicate the option you have previously set Flexible Product Fields plugin.
After selecting the action, indicate the trigger e.g. product, product category, etc. set the condition is or is not.
Cart conditional logic
Cart conditional logic allows any field to be displayed, hidden, or set as required, based on the total value in the basket.
The rule also requires, setting the condition is, more than or less than.
The final step is to indicate the value in the basket for which the logic will be implemented.
Cart contains conditional logic
Cart contains conditional logic that allows any field to be displayed, hidden, or set as required, based on the following:
- product,
- category,
- product type,
- number of items,
When the action is selected, the product, product category, etc. should be indicated, and the condition which is or which isnot.
The final step is to specify:
- products in the case of all products,
- the product categories in the case of product categories,
- the type of products, in the case of the indicated types (simple product, variant, subscription, etc.) of products,
- the number of items, in the case of the number of items in the basket.
User conditional logic
User conditional logic allows any field to be displayed, hidden, or set as required, based on user role.
When the action is selected, the condition is or is not should be selected. To complete the construction of the logic, it is still necessary to point out the specific role of the user:
- administrator,
- author,
- contributor,
- customer,
- editor,
- shop manager,
- subscriber,
Shipping method conditional logic
Shipping method conditional logic allows any field to be displayed, hidden, or set as required, based on the shipping method
When the action is selected, the condition is or is not should be selected. To complete the construction of the logic, it is still necessary to point out the specific shipping method.
Payment method conditional logic
Payment method conditional logic allows any field to be displayed, hidden, or set as required, based on the payment method.
When the action is selected, the condition is or is not should be selected. To complete the construction of the logic, it is still necessary to point out the specific payment method.
Date conditional logic
Date conditional logic allows any field to be displayed, hidden, or set as required, based on the date.
When the action is selected, the condition from or is until should be selected. To complete the construction of the logic, it is still necessary to point out the specific date.