Advertisement
MrJoshMiller

Keep profiles active

Apr 30th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.24 KB | None | 0 0
  1. { "rules_keep_profiles_active" : {
  2.     "LABEL" : "Keep profiles active",
  3.     "PLUGIN" : "reaction rule",
  4.     "REQUIRES" : [ "rules", "entity" ],
  5.     "ON" : [ "commerce_customer_profile_insert" ],
  6.     "DO" : [
  7.       { "entity_query" : {
  8.           "USING" : {
  9.             "type" : "commerce_customer_profile",
  10.             "property" : "uid",
  11.             "value" : [ "commerce-customer-profile:uid" ],
  12.             "limit" : "1000"
  13.           },
  14.           "PROVIDE" : { "entity_fetched" : { "old_profiles" : "old_profiles" } }
  15.         }
  16.       },
  17.       { "LOOP" : {
  18.           "USING" : { "list" : [ "old-profiles" ] },
  19.           "ITEM" : { "old_profile" : "old_profile" },
  20.           "DO" : [
  21.             { "component_rules_setting_old_profiles_to_be_inactive" : {
  22.                 "USING" : {
  23.                   "created_profile" : [ "commerce-customer-profile" ],
  24.                   "old_profile" : [ "old_profile" ]
  25.                 },
  26.                 "PROVIDE" : {
  27.                   "created_profile" : { "created_profile_returned" : "created_profile_returned" },
  28.                   "old_profile" : { "old_profile_returned" : "old_profile_returned" }
  29.                 }
  30.               }
  31.             }
  32.           ]
  33.         }
  34.       }
  35.     ]
  36.   }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement