Conditional logic
Conditional logic is a genuine feature of Visual Products Configurator. It allows you to show, hide, select, and deselect any options of your configurator under specific conditions. Those conditions are generally based on the user selections.
/!\ Associated post /!\
1. Enable conditional logic
Conditional logic is applied to configurations and is made of logic rules. To enable the feature, click on the “Manage conditional rules” button of your configuration. Then, check the “Enable Conditional Logic” checkbox and save.
Conditional Logic is a complex feature. Each rule created requires a few milliseconds of processing. So having too many rules could considerably increase the load time of the configurator
2. Logic rules overview
Logic rules are roughly made of 1 action and 1 or multiple conditions. The action is executed if the condition(s) are met.
2.1. Action
A rule can execute 3 actions listed in the dropdown: “Show“, “Hide” and “Select“
- Show: This action will reveal a component or an option if they are hidden
- Hide: This action will hide a component or an option
- Select: This action will select an option
2.2. Scope
The scope is the rule application area. 4 possible choices are listed in the dropdown. “Option“, “Component“, “Group per component” and “All Groups“. Any choice will generate a different content in the “Apply on” dropdown.
- Option: If chosen, all options will be listed in “Apply on” dropdown
- Component: If chosen, all component will be listed
- Group per component: If chosen, groups in each component will be listed.
- All groups: If chosen, all created groups in the configuration will be listed. If the a group name is present in multiple components, it will be listed once.
2.3. Apply on
This dropown will generate contents based on the chosen scope.
2.4. Option
The “Option” is the first part of the condition and basically the trigger for the execution of the rule. All options of all components are listed in the dropdown.
2.5. Status
This is the second part of the condition. It’s an action associated with the option. 2 possible choices are listed: “Is selected” and “Is deselected“
- Is selected: if chosen, the rule will be executed if the option is selected
- Is deselected: If chosen, the rule will be executed once the option is deselected
2.6. Add (+) and Remove (-)
The Plus (+) button allows you to add a condition to the rule while the Minus (-) button removes a condition.
2.7. Enable Reverse rule
Once the checkbox is checked, the opposite rule to the one you created is automatically generated. For example, if selecting an option A hides another option B, then, with the reverse rule enabled, the option B will show if the option A is deselected.
Keep in mind that activating the reverse rule will create an invisible, yet present rule. So if you have 10 rules with the reverse rule enabled, you actually have 20 rules in total.
2.8. Condition relationship
This setting is relevent when more than 1 condition are created. 2 possible choices: “AND” and “OR“
- AND: if chosen, the rule will be executed if all the conditions are met at the same time
- OR: if chosen, the rule will be executed if at least 1 of the conditions is met.
Last updated on May 15, 2023