Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_create_a_node_for_each_line_item_component" : {
- "LABEL" : "Create a node for each line item component",
- "PLUGIN" : "rule",
- "REQUIRES" : [ "rules" ],
- "USES VARIABLES" : { "line_item" : { "label" : "line_item", "type" : "commerce_line_item" } },
- "IF" : [
- { "entity_is_of_bundle" : {
- "entity" : [ "line-item" ],
- "type" : "commerce_line_item",
- "bundle" : { "value" : { "product" : "product" } }
- }
- },
- { "entity_has_field" : { "entity" : [ "line-item" ], "field" : "field_product" } }
- ],
- "DO" : [
- { "entity_query" : {
- "USING" : {
- "type" : "node",
- "property" : "field_product",
- "value" : [ "line-item:commerce-product:product-id" ],
- "limit" : "1"
- },
- "PROVIDE" : { "entity_fetched" : { "product_display" : "product_display" } }
- }
- },
- { "entity_create" : {
- "USING" : {
- "type" : "node",
- "param_type" : "page",
- "param_title" : [ "product-display:1:title" ],
- "param_author" : [ "line-item:order:owner" ]
- },
- "PROVIDE" : { "entity_created" : { "node_created" : "Created node" } }
- }
- },
- { "entity_save" : { "data" : [ "node-created" ] } }
- ],
- "PROVIDES VARIABLES" : [ "line_item" ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement