Advertisement
Guest User

Rule export that grants a role using Drupal Commerce

a guest
Sep 6th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. { "rules_grant_user_a_role" : {
  2. "LABEL" : "grant user a role",
  3. "PLUGIN" : "reaction rule",
  4. "REQUIRES" : [ "commerce_order", "rules", "commerce_checkout" ],
  5. "ON" : [ "commerce_checkout_complete" ],
  6. "IF" : [
  7. { "commerce_order_contains_product" : {
  8. "commerce_order" : [ "commerce_order" ],
  9. "product_id" : "IPH1-BLK-OS",
  10. "operator" : "=",
  11. "value" : "1"
  12. }
  13. }
  14. ],
  15. "DO" : [
  16. { "user_add_role" : {
  17. "account" : [ "site:current-user" ],
  18. "roles" : { "value" : { "3" : "3" } }
  19. }
  20. }
  21. ]
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement