Tags/topics: 
2
Answers
Vote up!
0
Vote down!

Shouldn't this rule create a line item for an order?

This rule executes without an error AND without adding a line item to order 76. What am I missing?

{ "rules_test_create_line_item" : {
"LABEL" : "TEST CREATE LINE ITEM",
"PLUGIN" : "action set",
"REQUIRES" : [ "rules" ],
"ACTION SET" : [
{ "entity_create" : {
"USING" : {
"type" : "commerce_line_item",
"param_order" : "76",
"param_type" : "product",
"param_line_item_label" : "TEST",
"param_quantity" : "1",
"param_commerce_unit_price" : { "value" : { "amount" : 9900, "currency_code" : "USD" } },
"param_commerce_total" : { "value" : { "amount" : 9900, "currency_code" : "USD" } }
},
"PROVIDE" : { "entity_created" : { "test" : "TEST" } }
}
},
{ "entity_save" : { "data" : [ "test" ], "immediate" : 1 } }
]
}
}

Asked by: videographics
on March 21, 2014

2 Answers

Vote up!
0
Vote down!

So, I checked the database and it did get created. I just need to figure out why it's not showing up with the order.

Answer by: videographics
Posted: Mar 21, 2014
Vote up!
0
Vote down!

So, it turns out this does create a line item. It shows up in the database. Unfortunately, it does not appear to be part of the order. In the database, this line item is identical to another line item that DOES appear on the order. (All the fields including the Order ID match exactly.) The only difference is that the one that works was created using the "Add Line Item" button in the interface. What's going on?

Answer by: videographics
Posted: Mar 22, 2014