Advertisement
MrJoshMiller

Setting old profiles to be inactive

Apr 30th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. { "rules_setting_old_profiles_to_be_inactive" : {
  2.     "LABEL" : "Setting old profiles to be inactive",
  3.     "PLUGIN" : "rule",
  4.     "REQUIRES" : [ "rules" ],
  5.     "USES VARIABLES" : {
  6.       "created_profile" : { "label" : "created_profile", "type" : "commerce_customer_profile" },
  7.       "old_profile" : { "label" : "old_profile", "type" : "commerce_customer_profile" }
  8.     },
  9.     "IF" : [
  10.       { "NOT data_is" : {
  11.           "data" : [ "created-profile:profile-id" ],
  12.           "value" : [ "old-profile:profile-id" ]
  13.         }
  14.       },
  15.       { "data_is" : { "data" : [ "old-profile:status" ], "value" : 1 } }
  16.     ],
  17.     "DO" : [
  18.       { "data_set" : { "data" : [ "old-profile:status" ], "value" : 0 } },
  19.       { "entity_save" : { "data" : [ "old-profile" ], "immediate" : 1 } }
  20.     ],
  21.     "PROVIDES VARIABLES" : [ "created_profile", "old_profile" ]
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement