Sell Advert nodes - copying Product Display fields to new entity node
I have a product type called "Ad top". Two custom fields: Duration (taxonomy term: 1,3,6,9,12 months) and Pages (Taxonomy term: Homepage, Other pages).
I created 10 products of the Ad top to cover all variations of Duration and Pages, each product has different price.
Then I created a Product Display: "Top Ad" with reference to all 10 products. When I view it I have two Dropdowns: Duration and Pages. depending on the dropdowns price changes as expected.
When order is paid in full I loop through all products in shopping cart.
Using Component - For each product I Create new entity Node of Content Type "Advertisement Top" that has fields Duration(taxonomy term) and Pages (taxonomy term).
What I want is to Set a data value of the Created Entity to values chosen on Product Display. But the values of these dropdowns are not accessible in Rules. Why the product fields are not accessible for Rules?
I tried using line item fields:
When I add custom fields Duration(taxonomy) and Pages(taxonomy) to Line Item /admin/commerce/config/line-items/product/fields
I can access value of these fields set at the Product Display node and I can easily Set a data value to new Entity. However this gives me 2x Duration and 2x Pages dropdowns that are not related to each other.
I know it is not the best solution but I am actually thinking about using product fields (dropdowns generated by Product Display) to get the correct price (pick the correct product) and whenever these dropdowns change I would copy the values to Line Item dropdowns. Then use Line Product fields to get the values and copy them to new Entity I create.
Does anybody have a better solution than this?
Finally I set the author of new node to basket owner and Save entity. This way user who bought the product automatically "creates" new node and is able to edit the content, set publishing date etc.