Howdy, @ruudvanbeek! Thanks for that, that’s just the information we needed.
So after looking into this a bit more, we were able to setup a Product Type condition that will be able to output a hardcoded condition for the basic WooCommerce types that come stock with the plugin, which includes:
- Simple
- Grouped
- External
- Variable
- Variation
However, WooCommerce does not have a way for us to automatically enumerate over the various types that may or may not be registered by a 3rd party plugin (“Composite” in your case). That being said, there are a couple of ways you can extend this list or leverage our new Element Condition Expressions with the next release…it really comes down to how you’d like to manage things.
First, if you would like for your “Composite” Products to show up in the Conditions list by default along with the previous types listed above, you can easily extend that list using a filter that will be available in the next release. To do this, you would just need to add the following code to your child theme’s functions.php
file:
add_filter( 'cs_conditions_wc_product_types', function( $types ) {
$types[] = [ 'value' => 'composite', 'label' => 'Composite' ],
return $types;
});
This will have that new type registered in the list for you to easily access. You could even reach out to the plugin developer and see if they would prefer to put this in their core code so that it’s just part of the product for anyone using Pro moving forward.
The other method would be to use the new {{dc:woocommerce:product_type}}
Dynamic Content string, which will be available in the next release. You can use this with an Element Condition Expression operating on a String to see if it matches your type, like so:
This will effectively perform the same action, it really comes down to which you prefer to setup and manage. Again, this will all be available in the next release. Once that’s out, you should be able to setup the conditions that you need. Hopefully this helps to get you moving in the right direction…cheers!