Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal Commerce come by default with rules for send several e-mails to the buyer and the seller I tried a standalone installation of Marketplace module and also the Marketplace profile but there I didn't see any rule for this..
Will be useful send a email to the store owner every time a checkout is completed (checkout in his store, of course).
UPDATE: I don't know from where I took that Commerce bring that function by default, maybe because I have it like this in the profile I use for start commerce's projects. In any way I think is a nice feature and I will be working on ;)
Comments
Comment #1
hedel CreditAttribution: hedel commentedComment #2
Chithra K CreditAttribution: Chithra K commentedWell, you can achieve this by the below rule.
{ "rules_vendor_notification_on_customer_order" : {
"LABEL" : "Vendor Notification on Customer Order",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "entity" ],
"ON" : { "commerce_order_update" : [] },
"IF" : [
{ "entity_is_of_bundle" : {
"entity" : [ "commerce-order" ],
"type" : "commerce_order",
"bundle" : { "value" : { "commerce_store_order" : "commerce_store_order" } }
}
},
{ "data_is" : { "data" : [ "commerce-order:status" ], "value" : "pending" } },
{ "data_is" : {
"data" : [ "commerce-order:status" ],
"value" : [ "commerce-order:status" ]
}
}
],
"DO" : [
{ "entity_fetch" : {
"USING" : { "type" : "user", "id" : [ "commerce-order:cmp-o-store:uid:uid" ] },
"PROVIDE" : { "entity_fetched" : { "store_user_id" : "Store user id" } }
}
},
{ "entity_fetch" : {
"USING" : { "type" : "commerce_store", "id" : [ "commerce-order:cmp-o-store:id" ] },
"PROVIDE" : { "entity_fetched" : { "commerce_store_id" : "Commerce Store Id" } }
}
},
{ "mail" : {
"to" : [ "store-user-id:mail" ],
"subject" : "Customer Order!",
"message" : "Greetings, [store-user-id:name]!\r\n\r\nYour product has sold.\r\nYou can view the order here [site:url]commerce_store\/store\/[commerce-store-id:id]\/sales\/[commerce-order:order-id].\r\n\r\nThanks\r\n[site:name] Team",
"language" : [ "" ]
}
}
]
}
}
Comment #3
IgnacioAlonso CreditAttribution: IgnacioAlonso commentedError at import rules from #2:
Integrity check for the imported configuration failed. Error message: Data selector commerce-order:cmp-o-store:uid:uid for parameter id is invalid.
I change
"USING" : { "type" : "user", "id" : [ "commerce-order:cmp-o-store:uid:uid" ] },
for
"USING" : { "type" : "user", "uid" : [ "commerce-order:cmp-o-store:uid:uid" ] },
And then, other error:
Integrity check for the imported configuration failed. Error message: Missing configuration for parameter id.
Comment #4
hedel CreditAttribution: hedel commentedI confirm the comment #3 and I don't know from where come "commerce-order:cmp-o-store:uid:uid".
Also I don't understand why ""ON" : { "commerce_order_update" : [] }," and not when a checkout is complete?