Hello, I have added a Commerce Option Set to the product type "Kayaks", which is a single checkbox option called "Clear Hull Option". My problem is that I cannot understand how to create a rule to add an extra $250 to the product when that checkbox is set, see attached screenshots.

I have found some info from other posts, but I am still not sure how to "load all options by a given property" or ""fetch entity by property" as hunziker has explained below. I believe that orbface9 created some code for rules integration, but it looks like that code is not going to be be added to the module. Is there any more detail someone can give on how a rule like this would be set up?

Here is the info I have found w/links to the original posts:

You need to load all options by a given property. In this case the line item id. You have always multiple options per line item. - hunziker

You could access the options by using a second rule. There you can add some assertion to access the fields. This is the general solution. For options you could use "fetch entity by property". As the property to filter you need to use the line item. Then you can loop over the options and depending on the found option you could change the line item. I know we can elaborate this by adding more sophisticated events / actions / conditions, but since Drupal Commerce is not really stable, we are more stable if we are using rules. (Rules complains at least if something is wrong.) - hunziker

Comments

7thkey’s picture

Have you found a way to make it work?

7thkey’s picture

Issue summary: View changes

adding more details for clarification

Anonymous’s picture

Status: Active » Closed (duplicate)