Store Owner’s Guide – Beyond Basics

Option Dependencies ↑ Back to top

The Composite type allows you to make specific product/variation selections conditionally available based on compatibility limitations that may exist between products/variations in different Components.

This is possible using Scenarios, which can be understood by looking at a practical example. The Full Frame DSLR Kit composite product:

The Full Frame DSLR Kit composite product.
The Full Frame DSLR Kit composite product.

The kit consists of the following Components:

  • Camera Body
  • Lens
  • Memory Card

Without any Scenario definitions, it is possible to select and purchase any Camera, Lens and Memory Card combination, including potentially incompatible parts.

In this scenario, Cameras only work with Lenses of the same manufacturer. Additionally, each Camera works with a specific Memory Card type.

To ensure that only compatible products can be selected and purchased together, Scenarios can be used to define the valid combinations of Camera, Lens and Memory Card selections.

For simplicity, the Full Frame DSLR Kit used in this example includes only 2 Cameras, 6 Lenses and 2 Memory Cards. These relatively few options translate into 24 different configurations – out of these 24, only 6 are valid.

Fortunately, only 2 Scenarios are required to describe the valid Full Frame DSLR Kit configurations:

Defining the valid configurations of the Full Frame DSLR Kit composite product using Scenarios.
Defining the valid configurations of the Full Frame DSLR Kit using Scenarios.

How Scenarios Work ↑ Back to top

Every time you make a new product/variation selection, the chosen options are used to create a list of matching Scenarios. Then, a series of actions associated with these matching Scenarios is triggered. Matching conditions for a Scenario are defined under the Scenario Configuration section, while the associated action is defined by ticking an option in the Scenario Actions section.

The Create Dependency Group action uses the products/variations included in the Scenario to define a valid combination set. Products/variations that are not found in any matching Scenario are disabled and cannot be chosen.

This is easier to understand by looking at the Full Frame DSLR Kit example. After having chosen the Canon DSLR camera in the first step, it is not possible to choose the Nikon lens in the next step:

Incompatible Lens options are greyed-out.
Incompatible Lens options are greyed-out.

The same can be observed with the Memory Card options:

Incompatible Memory Card options are greyed-out.
Incompatible Memory Card options are greyed-out.
Disabled product/variation selections are greyed-out by default. You can hide them with this snippet.

Scenarios: Configuration ↑ Back to top

To create a Scenario:

  1. Go to Product Data > Scenarios.
  2. Click Add Scenario.
  3. Assign a Name and – optionally – a Description to the created Scenario.
  4. Define matching conditions in the Scenario Configuration section by including or excluding product/variation selections. Choose selection is or selection is not in the drop-down associated with each Component to include or exclude the specified products/variations. To add all products and variations without selecting them one by one, choose Any Product or Variation.
  5. Tick an action associated with the created Scenario: Create Dependency Group or Hide Components.
Optional Components have a No Selection state that can be referenced in Scenario matching conditions.

In the Full Frame DSLR Kit example, No Selection has been included in the Memory Card Component in both Scenarios. This allows customers to skip the (optional) Memory Card Component without choosing an option.

When creating Scenarios to introduce option dependencies:

  • The Create Dependency Group action must be enabled to define a valid combination set.
  • The defined Scenarios must include all valid combination sets.

Component Masking

As the count of Components, Component Options, or dependencies increases, the process of splitting up product/variation selections into valid combination sets can become quite tedious. To make things easier, the extension allows you to focus on fewer Components and fewer dependency relationships at a time, by allowing you to mask Components when defining Scenario matching conditions.

Consider a Composite Product with the following simple structure:

Component Name Component Options
Component 1 Products X & Y
Component 2 Products A, B & C
Component 3 Products K & L

The following dependencies exist:

  • X is compatible with A and B.
  • Y is compatible with B and C.
  • A is compatible with K only.
  • B is compatible with L only.

Without Component Masking

Without the ability to mask Components, the easiest way to create these dependencies with Scenarios is to:

  1. Make a list of all selection combinations: [ 2 selections in Component 1 ] x [ 3 selections in Component 2 ] x [ 2 selections in Component 3 ] = 12.
  2. Go through each combination of products and determine whether it’s a valid one. If so, create a new Scenario and use the combination as a matching condition.
  3. Tick the Create Dependency Group action.

The result — 5 valid combinations and an equal number of Scenarios: X-A-K, X-B-L, Y-B-L, Y-C-K and Y-C-L.

Note that it is possible to reduce these Scenarios to the following 3: X-A-K, XY-B-L, and Y-C-KL.

With Component Masking

Component masking makes it possible to transform the dependencies into Scenarios in a more direct manner: X-AB-masked, Y-BC-masked, masked-A-K and masked-B-L.

Adding a large number of Scenarios manually can be impractical. For demanding applications, the Composite Products Filters API can be used to create custom Scenario definitions dynamically.
Note: We are unable to provide support for customizations under our Support Policy. If you are unfamiliar with using an API, select a WooExpert or Developer for assistance.

Conditional Components ↑ Back to top

In addition to creating option dependencies, Scenarios can be used to conditionally disable and hide individual Components based on product/variation selections.

This allows you to create multiple configuration paths by introducing or removing Components as product/variation selections are being made.

To understand how Scenarios work, refer to How Scenarios Work.

Configuration ↑ Back to top

To conditionally disable a Component, follow these steps:

  1. Go to Product Data > Scenarios.
  2. Click Add Scenario.
  3. Assign a Name and/or Description to the created Scenario.
  4. Define selection matching conditions in the Scenario Configuration section by including or excluding products/variations. Choose selection is or selection is not in the drop-down associated with each Component to include or exclude the specified products/variations. To add all products and variations without selecting them one by one, choose Any Product or Variation.
  5. Tick the Hide Components action.
  6. Choose one or more Components to disable.

Selecting Multiple Component Options ↑ Back to top

Out of the box, it is only possible to select one option under each Component.

However, it’s possible to choose multiple products under a single Component by using Product Bundles in combination with Composite Products.

The concept is easier to understand with an example based on the Full Frame DSLR Kit. Our objective is to offer the following optional products in an additional Accessories Component:

  • Backpack
  • Neoprene Cover
  • Dust-Aid Sensor Cleaner

Customers will be able to choose any combination of accessories, without being limited to a single selection.

Accessories Component with multiple optional items.
Accessories Component with multiple optional items.

The Accessories component can be created by following these steps:

  1. Using the Product Bundles extension, create a new product bundle and add the products that you want to appear in the Accessories Component inside this bundle, ensuring they are all Optional. Then, set its Catalog visibility status to Hidden. For guidance, refer to the Product Bundles documentation.
  2. Create the Accessories Component and add this newly created bundle as its only Component Option.
  3. In the Advanced Settings section of the Accessories Component, locate the Selected Option group and check the Hide Title and Hide Thumbnail options.
Note: When using this technique to offer multiple optional products under a single Component, keep in mind that some Composite Products features will not work as expected. In the previous example:

  • The products listed under the Accessories Component cannot be paginated, sorted, or filtered.
  • You cannot use Scenarios to make the products listed under the Accessories Component conditionally available.

Questions & Support ↑ Back to top

Have a question? Please fill out this pre-sales form.
Already purchased and need assistance? Get in touch with us via the Help Desk!

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top