Woo Additional Terms logo Woo Additional Terms

Conditional Logic

This document explains how to create conditional T&C checkboxes with if-this-then-that logic.

Woo Additional Terms logo

Woo Additional Terms

Unlimited customizable T&C checkboxes

Conditional logic allows you to set rules and conditions that alter terms and conditions checkboxes based on the cart and checkout details.

Smart logic helps you reduce the risks associated with legal agreements by automating certain rules and clauses within “I agree” checkboxes to suit specific use cases and concerns.

For example, if users add a specific product item to the cart, conditional logic will trigger specific T&C checkboxes to be either hidden or shown accordingly on a checkout page.

Create Conditional Logic

You can set smart logic while creating or editing a terms field. Creating your rules and conditional checkboxes can make your store’s policies more comprehensible for users.

Add a conditional rule to a terms and condition checkbox
Add a conditional rule to a terms and condition checkbox
How to use Conditional Logic to create dynamic terms and condition checkboxes?
  1. Navigate to WooCommerceSettingsAdditional Terms.
  2. Go to the Terms section within the current tab.
  3. Hover over the terms checkbox and select Edit.
  4. Click on the Add condition button in the Conditions table.
  5. Enter a friendly Name for the condition.
  6. Choose a Rule to restrict your term and condition checkbox.
  7. Select which Operator you want to apply for this condition.
  8. Depending on the rule you have defined for the condition at the top, you will see a variety of options to choose from.
  9. Click on the Save changes button.

Restrict by Products

You can set conditional logic to a terms and condition checkbox based on the Products in the cart. For instance, using smart logic, the age agreement checkbox could be displayed in the checkout when users add a tobacco product to the cart.

Restrict terms and condition checkbox by products
Restrict terms and condition checkbox by products
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Products using the Rule dropdown.
  6. Use the Operator dropdown to select whether the cart items contain individual products (the chosen products in the following field).
    • Contain - If the shopping cart contains at least one of the required products, the terms checkbox will show on the checkout page.
    • Does not contain - If the shopping cart doesn’t contain any of the specific products, the terms checkbox will show on the checkout page.
  7. Choose the Products you want to set for the conditional rule. The combination between multiple products is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Restrict by Categories

You can set conditional logic to a terms and condition checkbox based on the Categories of the products in the cart. For instance, using smart logic, the warranty agreement checkbox could be displayed in the checkout when users add a product from the appliance category to the cart.

Restrict terms and condition checkbox by categories
Restrict terms and condition checkbox by categories
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Categories using the Rule dropdown.
  6. Use the Operator dropdown to select whether the cart items contain specific categories (the chosen categories in the following field).
    • Contain - If the shopping cart contains at least one item of the required categories, the terms checkbox will show on the checkout page.
    • Does not contain - If the shopping cart doesn’t contain any item of the specific categories, the terms checkbox will show on the checkout page.
  7. Choose the Categories you want to set for the conditional rule. The combination between multiple categories is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Restrict by Tags

You can set conditional logic to a terms and condition checkbox based on the Tags of the products in the cart. For instance, using smart logic, the damaged goods checkbox could be displayed in the checkout when users add a product from the fragile goods tag to the cart.

Restrict terms and condition checkbox by tags
Restrict terms and condition checkbox by tags
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Tags using the Rule dropdown.
  6. Use the Operator dropdown to select whether the cart items contain specific tags (the chosen tags in the following field).
    • Contain - If the shopping cart contains at least one item of the required tags, the terms checkbox will show on the checkout page.
    • Does not contain - If the shopping cart doesn’t contain any item of the specific tags, the terms checkbox will show on the checkout page.
  7. Choose the Tags you want to set for the conditional rule. The combination between multiple tags is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Restrict by Product Types

You can set conditional logic to a terms and condition checkbox based on the Types of products added to the cart. For instance, using smart logic, the recurring payment agreement checkbox could be displayed in the checkout when users add a subscription product to the cart.

Restrict terms and condition checkbox by product types
Restrict terms and condition checkbox by product types
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Types using the Rule dropdown.
  6. Use the Operator dropdown to select whether the cart contains products from specific types (the chosen types in the following field).
    • Contain - If the shopping cart contains at least one item of the required product types, the terms checkbox will show on the checkout page.
    • Does not contain - If the shopping cart doesn’t contain any item of the specific product types, the terms checkbox will show on the checkout page.
  7. Choose the product Types you want to set for the conditional rule. The combination between multiple tags is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Restrict by Shipping Classes

You can set conditional logic to a terms and condition checkbox based on the Shipping Classes of products in the cart. For instance, using smart logic, the bulk commodities agreement checkbox could be displayed in the checkout when users add a product from the bulk shipping class to the cart.

Restrict terms and condition checkbox by shipping classes
Restrict terms and condition checkbox by shipping classes
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Shipping Classes using the Rule dropdown.
  6. Use the Operator dropdown to select whether the cart contains products from specific shipping classes (the chosen shipping classes in the following field).
    • Contain - If the shopping cart contains at least one item of the required shipping classes, the terms checkbox will show on the checkout page.
    • Does not contain - If the shopping cart doesn’t contain any item of the specific shipping classes, the terms checkbox will show on the checkout page.
  7. Choose the Shipping Classes you want to set for the conditional rule. The combination between multiple shipping classes is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Restrict by Shipping Locations

You can set conditional logic to a terms and condition checkbox based on the users' Shipping Locations. For instance, using smart logic, the California Consumer Privacy Act (CCPA) terms checkbox could be displayed in the checkout when users make purchases from California.

Restrict terms and condition checkbox by shipping locations
Restrict terms and condition checkbox by shipping locations
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Shipping Locations using the Rule dropdown.
  6. Use the Operator dropdown to select whether a user purchases from specific Locations (the chosen shipping locations in the following field).
    • Contain - The terms checkbox will show on the checkout page if the user’s shipping location is one of the selected locations.
    • Does not contain - If the user’s shipping location is not included in the selected locations, the checkout page will display the terms checkbox.
  7. Choose the Shipping Locations you want to set for the conditional rule. The combination between multiple shipping locations is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Restrict by WooCommerce Brands

The Woo Additional Terms (PRO) plugin is integrated with WooCommerce Brands plugin. You can set conditional logic to a terms and condition checkbox based on the Brands of products in the cart. For instance, using smart logic, the license terms checkbox could be displayed in the checkout when users add a product from a certain brand to the cart.

Restrict terms and condition checkbox by brands
Restrict terms and condition checkbox by brands
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Click on the Add condition button in the Conditions table.
  4. Enter a friendly Name for the condition.
  5. Select Brands using the Rule dropdown.
  6. Use the Operator dropdown to select whether the cart contains products from specific brands (the chosen brands in the following field).
    • Contain - If the shopping cart contains at least one item of the required brands, the terms checkbox will show on the checkout page.
    • Does not contain - If the shopping cart doesn’t contain any item of the specific brands, the terms checkbox will show on the checkout page.
  7. Choose the Brands you want to set for the conditional rule. The combination between multiple brands is or, which means if-this-or-this-then-that.
  8. Click on the Save changes button.

Complex Conditional Logic

You can create complex logic to display a terms checkbox by adding multiple conditional rules. For example, you could use a conditional rule to display a checkbox if a certain state is met, such as if users add products from a specific product type to the cart, the terms checkbox will show in the checkout. You could also use multiple rules to combine various conditions, such as displaying a terms checkbox if users add products from a specific product type and category to the cart. Additionally, you could use “not” operators to negate certain conditions, such as displaying a terms checkbox only if users don’t add a specific product to the cart.

Multiple conditional rules will combine with “and”. Therefore, All conditions must be valid in order for the statement to be true.

Conditions Table

You can review the list of defined conditions for each term checkbox at a table on the edit term page.

Overview conditions table
Overview conditions table
  • Name - Displays the name of your condition. A horizontal line (—) displays for empty naming if you haven't entered a custom name when creating the condition.
  • Status - Displays the activation status of your condition. You can change the status by clicking on the toggle in this column.
  • Rule - Displays the condition statement or "if-then" statement that defines the condition under which a certain action or result will occur.

Edit Conditions

After you add a condition to a terms checkbox, you can edit its details to apply new changes.

Edit condition details
Edit condition details
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Go to the Conditions table.
  4. Hover over the terms condition and select Edit.
  5. Apply your new changes as you wish.
  6. Click on the Save changes button.

Remove Condition

You can remove and delete a condition at any moment.

Remove conditions
Remove conditions
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Go to the Conditions table.
  4. Hover over the terms condition and select Delete permanently.
  5. On the message, click the Ok button and confirm to remove your conditional logic from the terms checkbox.
  6. Click on the Save changes button.
Deleting a conditional logic will remove it permanently, so it can’t be restored.

Disable Condition

You can enable or disable the conditional logic for a terms checkbox by toggling the switch in the Status column.

Disable condition by toggling the status
Disable condition by toggling the status
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Go to the Conditions table.
  4. Click the toggle in the Status column to disable or activate a condition.
  5. Click on the Save changes button.

Sorting Conditions

When you have multiple conditions for a terms checkbox, you can reorder those via drag and drop in the correct order to ensure that the conditional logic is executed correctly and produces the desired outcome.

Sorting conditions
Sorting conditions
  1. Navigate to WooCommerceSettingsAdditional TermsTerms.
  2. Hover over the terms checkbox and select Edit.
  3. Go to the Conditions table.
  4. Using the left handle, Grab the condition.
  5. Hold the condition and drag it up and down and change the order.
  6. Drop the condition at a new position.
  7. Click on the Save changes button.

Did you find this article helpful?

  • Version

    1.0.0

  • Last updated

    01/01/2023

  • WordPress Version

    5.5 or higher

  • Tested up to

    6.1.1

  • WooCommerce

    4.0 or higher

  • PHP Version

    7.4 or higher