This is what I have so far-
{ "rules_split_quantity" : {
"LABEL" : "Split Quantity",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "commerce_cart" ],
"ON" : [ "commerce_cart_product_add" ],
"IF" : [
{ "entity_is_of_type" : { "entity" : [ "commerce-line-item" ], "type" : "commerce_line_item" } },
{ "entity_is_of_type" : { "entity" : [ "commerce-order" ], "type" : "commerce_order" } }
],
"DO" : [
{ "data_calc" : {
"USING" : { "input_1" : [ "quantity" ], "op" : "-", "input_2" : "1" },
"PROVIDE" : { "result" : { "result" : "Calculation result" } }
}
},
{ "commerce_cart_product_add_by_sku" : {
"USING" : {
"user" : [ "site:current-user" ],
"sku" : "[commerce-product:sku]",
"quantity" : [ "result" ],
"combine" : 0
},
"PROVIDE" : { "product_add_line_item" : { "product_add_line_item" : "Added product line item" } }
}
}
]
}
}
Its adding products back to the cart with one less in the quantity but its not making multiple lines just one with multiple quantities?
Any ideas?
Thanks,
Ben
Comments
Hi Ryan,
Will have a crack at doing it with rules in the morning. Appreciate your response and will post back.
Thanks,
Ben