1
Answers
Vote up!
0
Vote down!

How do you get commerce customizable product information into a node for publicly viewing?

I am currently using Commerce Customizable Products to sell listing for a site to part of a site's directory. Getting all that informations is fine and rules seems ideal to get that data into a node.

The problem for me comes up when setting up the rule correctly. Selecting the correct data selector or replacement token isn't clear to me. I see things like "commerce-order:commerce-line-items:0:" but that isn't helpful or clear if that's the right track.

Should I look at something else like entity or do i need to write a custom module?

Asked by: Dorian Kernytsky
on August 14, 2013

1 Answer

Vote up!
2
Vote down!

Great question Dorian!

This is a simple way to enable users to sell content, just create a node once the Order has been paid in full.

STEP BY STEP

1) Create a field on your Line item: admin/commerce/config/line-items/product/fields

2) Create a field on your Content Type: admin/structure/types/manage/article/fields

3) Add a "rule" component here: admin/config/workflow/rules/components/add

- You'll want the "Rule" component plugin
- Add an Line item entity called "line_item" and make sure it's parameter+provided

4) Add a condition for "Entity has bundle" and make sure the line item entity is of bundle "Product"

5) Add an action for "Create a new Entity" and we want to create a new node of bundle article

6) Add an action for "Set a Data Value" and we want to set a data value for the new entity's field based on the line item's field

7) Create a new rule here: admin/config/workflow/rules/reaction/add and choose the event under "Payment" called "When an order is first paid in full"

8) Add a loop on the Order:Line-items

9) Add an action under "Components" and look for the component you created in step 3

10) Profit!

Josh Miller
Answer by: Josh Miller
Posted: Aug 14, 2013

Comments

Thanks a lot, Josh! My just got back into the office today. With some of my early test, this seems to work.

- Dorian Kernytsky on August 16, 2013