Add conditional logic in Woocommerce composite products scenario
Scenarios are great, but still very basic as far as conditional logic is concerned.
Here's a list of interesting additions:
- Enable Component specific scenarios as opposed to having to systematically involve every component of composite product
- Conditional components (if a specific component is selected then other component becomes available/unavailable, defaults to a specific value or is hidden/displayed).
Fine Love Dolls commented
This isn't really a niche feature guys, Geoff was right 6 years ago and even more today in 2020 I believe. This approach is not scalable for products that have more than 1 or 2 conditional fields logic, it means dozens of scenarios would have to be created AND you don't give the option to duplicate scenarios so that we can win time at least here, especially given that only minor modifications have to be made to each scenario variation each time. We have to manually recreate every relationship...ain't nobody got time for that.
Please look at gravity forms approach which is much easier to setup and much more flexible...
Right now i'm stuck having to explain at each step which option isn't compatible with which, and having people select options because they can't be hidden when they should. This complicates things greatly and adds a lot of confusion
Of course you have great features that can't be replaced here such as filters but I am growing increasingly concerned because of how confusing my composite products are getting
Regarding Component-specific scenarios:
Dependencies could be implemented simply using a sequential logic describing the allowed alternatives when following a progressive selection path, or by using a combinational logic to describe the allowed solutions without caring about the progression.
The first could be implemented using simple sets of rules that relate the allowed options of a Component to the options made in the previous Components. *However*, to be practical this approach would only allow selecting options progressively, ie starting with the 1st Component, then moving to the 2nd, and so on.
Scenarios follows the second approach which doesn't have any "memory" - this means that you can create any sort of dependency you like, including multi-component dependencies, without having to force a progressive selection route. In the docs example, you can start by selecting a Lens that you like without knowing or caring which Cameras it is compatible with.
Some applications assume dependencies which have an inherent progression (ie *this* Camera is not compatible with *that* Lens), but there are cases where this is not desirable or possible, because all components are of equal importance to the whole.
The downside is that Scenarios are more complex. If the configuration of your Composite needs to have a simple progression and your restrictions are based on this progression, you will need a slightly analytical approach to break down the problem into Scenarios.
In short, Scenarios forces you to think about which items can co-exist in a possible configuration - put simply, you need to define all possible outcomes.
Reagrding Conditional components:
This can be done using Scenarios. If you just define a Component as optional, you can make the None option available in certain Scenarios. In those Scenarios, it won't be possible to select anything for the specific Component, which is the same as saying that the Component itself is conditional.
Conditional default options is really overkill - such a niche feature would never justify its development and maintenance cost.