1. Home
  2. WooCommerce Product Options
  3. FAQ

How to add conditional logic to your product add-ons

When you use the WooCommerce Product Options plugin to create your product add-ons, it's easy to add conditional logic. Each product add-on comes with an option to show or hide it based on the user's other selections. That way, you can create dependencies between your options or add-ons.

An example of conditional logic

For example, in the below screenshot, clicking 'Use pre-built template' conditionally displays the 'Your name' and 'Job title' product options, which are not required when 'Upload my own design' is selected:

WooCommerce product add-ons conditional logic

How to add conditional logic to product add-ons

  1. Edit the option group that contains the options that you want to add conditional logic to.
  2. Click to add or edit an option, and add each add-on as a separate 'Choice'.
  3. Click on the 'Advanced' toggle to display the conditional logic section.
  4. Select the logic that you require.

For example, the following screenshots show how we added a gift wrap option to a product. The product page loads with only one add-on visible: "Gift Wrapping." When the customer clicks the "Yes please" checkbox, the other gift wrap product add-ons appear underneath using conditional logic.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.