Modifying Commerce Product Fields with Rules

Hello everyone!

I am working on a rule to create an organic group node based on a commerce product after it is purchased. So far I’ve been successful in creating the entity and filling in fields from the product fields. I am having trouble updating a field within the product to reference the node created by it’s sale. I’m not receiving an error, but the product field is not updating. I’ve tried multiple configurations. Here’s the rule exported:

{ “rules_create_projects_from_sold_instrumentals” : {
“LABEL” : “Create Projects from Sold Instrumentals”,
“PLUGIN” : “reaction rule”,
“OWNER” : “rules”,
“REQUIRES” : [ “commerce_order”, “rules_conditional”, “rules”, “commerce_checkout” ],
“ON” : { “commerce_checkout_complete” : [] },
“IF” : [
{ “commerce_order_contains_product_type” : {
“commerce_order” : [ “commerce_order” ],
“product_type” : { “value” : { “instrumental” : “instrumental” } },
“operator” : “u003E=”,
“value” : “1”
}
}
],
“DO” : [
{ “LOOP” : {
“USING” : { “list” : [ “commerce-order:commerce-line-items” ] },
“ITEM” : { “list_item” : “Current list item” },
“DO” : [
{ “CONDITIONAL” : [
{
“IF” : { “entity_has_field” : { “entity” : [ “list-item” ], “field” : “commerce_product” } },
“DO” : [
{ “CONDITIONAL” : [
{
“IF” : { “data_is” : {
“data” : [ “list-item:commerce-product:type” ],
“value” : “instrumental”
}
},
“DO” : [
{ “entity_create” : {
“USING” : {
“type” : “node”,
“param_type” : “recording”,
“param_title” : [ “list-item:commerce-product:title” ],
“param_author” : [ “commerce-order:owner” ]
},
“PROVIDE” : { “entity_created” : { “pr_created” : “PR Created By Instr Order” } }
}
},
{ “list_add” : {
“list” : [ “list-item:commerce-product:field-project” ],
“item” : [ “pr-created” ],
“unique” : “1”
}
},
{ “data_set” : {
“data” : [ “pr-created:field-recording-cover-art” ],
“value” : [ “list-item:commerce-product:field-cover-art” ]
}
},
{ “data_set” : {
“data” : [ “pr-created:field-pr-producer” ],
“value” : [ “list-item:commerce-product:field-producer” ]
}
}
]
}
]
}
]
}
]
}
]
}
}
]
}
}

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed