Articles in this section
Display Rules
Updated
Display rules are a set of conditions that can be set for sections & fields to control their display on the checkout page. This means you can set certain conditions for showing or hiding fields & sections on the checkout page.
This article will help you to understand display rules settings, and will also explain all the different types of conditions available for setting display rules.
In this article
- General instructions to set display rules
- Conditions based on user role
- Conditions based on cart totals
- Conditions based on products
- Conditions based on product categories
- Conditions based on other field's value
- Conditions based on input fields (Text, Hidden, Password, and Textarea)
- Conditions based on option value
General instructions to set display rules
This section will explain to you the common steps to set display rules.
To set display rules for checkout fields or sections:
Navigate to the WooCommerce → Checkout & Register Editor.
Open the field/section property form popup.
- Click on the Add Field button to open the popup form if you are setting display rules for a new field.
- Click on the Edit Field button to open the popup form if you are setting display rules for an existing field.
- Click on the Add New Section button to open the popup form if you are setting display rules for a new section that you are creating.
- Click on the Edit Section button to open the popup form if you are setting display rules for an existing section.
Navigate to the Display Rules tab from the popup.
From this tab, you can define display rules. Here you can see two sets of rules, the first one will be validated before loading the checkout page. And the other one will be validated once the page is loaded. You can add multiple conditions to each rule.
Click on the AND or OR operator button to add multiple conditions and use these operators properly based on your requirement.
Once the required conditions are added, click on the Save Field button to save the settings.
Conditions based on user role
Show or hide fields & sections based on user role. Below is the list of conditions available to display fields & sections based on the user role.
User role equal to
User role not equal to
Example # 1:Show field xyz only for “Shop Manager”
Example # 2:Hide field xyz for “Shop Manager” and “Administrator”
Conditions based on cart totals
Show or hide fields & sections based on cart totals. Below is the list of conditions available to display fields & sections based on the cart totals.
Cart total equal to
Cart total greater than
Cart total less than
Cart subtotal equal to
Cart subtotal greater than
Cart subtotal less than
Example #1:Show field xyz if the cart total amount is between $200 & $300
Conditions based on products
Show or hide fields & sections based on products. Below is the list of conditions available to display fields & sections based on products in the cart.
Cart contains
Cart not contains
Cart only contains
Example #1:Show field xyz if cart contains the product T-Shirt with Logo
Conditions based on product categories
Show or hide fields & sections based on product categories. Below is the list of conditions available to display fields & sections based on the categories of the products in the cart.
Cart contains
Cart not contains
Cart only contains
Example #1:Show field xyz if the cart contains products only from the category T-Shirt
Conditions based on other field's value
This option allows you to set conditions based on other field’s value. Below is the list of conditions available to display fields & sections based on other fields’ value.
Is empty
Is not empty
Value equals to
Value not equals to
Value greater than
Value less than
Date equals to
Date not equals to
Date after
Date before
Day equals to
Day not equals to
Is checked
Is not checked
Conditions based on input fields (Text, Hidden, Password, and Textarea)
Follow the below steps for the field types like text, textarea, password, and hidden.
From the Select box, pick the specific field based on which the rule has to be set.
Choose the required condition from the next drop-down.
Enter the option value in the input field at the right.
Use the OR function to set condition rules based on more than one option text.
Save the changes made.
Conditions based on option value
For Select and Radio
From the Select box, pick the specific field based on which the rule has to be set.
Choose the required condition from the next drop-down.
Enter the option value in the input field at the right.
Use the OR function to set condition rules based on more than one option text.
Save the changes made.