Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_default_organization" : {
- "LABEL" : "Add a default organization on Order Completion if none exists",
- "PLUGIN" : "reaction rule",
- "REQUIRES" : [ "rules", "entity" ],
- "ON" : [ "commerce_order_update" ],
- "IF" : [
- { "data_is" : { "data" : [ "commerce-order:status" ], "value" : "checkout_complete" } },
- { "entity_has_field" : { "entity" : [ "commerce-order" ], "field" : "commerce_customer_billing" } },
- { "entity_has_field" : {
- "entity" : [ "commerce-order:commerce-customer-billing" ],
- "field" : "commerce_customer_address"
- }
- },
- { "data_is_empty" : { "data" : [
- "commerce-order:commerce-customer-billing:commerce-customer-address:organisation-name"
- ]
- }
- }
- ],
- "DO" : [
- { "data_set" : {
- "data" : [
- "commerce-order:commerce-customer-billing:commerce-customer-address:organisation-name"
- ],
- "value" : "Google, Inc."
- }
- },
- { "entity_save" : { "data" : [ "commerce-order" ] } }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement