0

This is the scenario :

Designing a automation website, user buys a product of type "EditOption", an EditOption consist of an editor and a task. When a user buy one of these products a new content of type "Project" should be created automatically, containing Editor and the task which must be assigned to him/her. So what I want is to fetch EditOption's Data from commerce order so these can be used later creating the new content.

I'm looking for a solution based on rules events.

The problem I faced is I can't get through commerce-line-items to fetch it's data. this is the result I get :

enter image description here

1 Answer 1

0

The solution I found:

First of all we need to create a Component which takes commerce-line-item as input,there we add some conditions to check if the item we are processing is of our desired type or not,this is how it configured :

enter image description here

Note that the way conditions are sorted is important.

Now after setting these conditions rules know that the item is definitely of type 'EditOption' so now all fields related to these type is accessible like below :

enter image description here

to create a content of type project I created another component which takes editor and 'EditOption' as inputs and the created my desired entity.(it is called in first component using data fetched from order)

the final step was to add an action of my first component in loop for each commerce-line-item of order.

here is the image :

enter image description here

Everything works fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.