You are here

function course_uc_default_rules_configuration in Course 7

Same name and namespace in other branches
  1. 8.3 modules/course_uc/course_uc.module \course_uc_default_rules_configuration()
  2. 8.2 modules/course_uc/course_uc.module \course_uc_default_rules_configuration()
  3. 7.2 modules/course_uc/course_uc.module \course_uc_default_rules_configuration()

Implements hook_default_rules_configuration().

Define the rule that enrolls users into purchased courses.

File

modules/course_uc/course_uc.module, line 519

Code

function course_uc_default_rules_configuration() {
  $configs = array();
  $rule = '{ "rules_enroll_user_in_ordered_courses_when_order_marked_as_comple" : {
    "LABEL" : "Enroll user in ordered courses when order marked as complete",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "course_uc", "uc_order" ],
    "ON" : [ "uc_order_status_update" ],
    "IF" : [
      { "data_is" : { "data" : [ "updated-order:order-status" ], "value" : "completed" } }
    ],
    "DO" : [
      { "course_uc_enroll_user_in_ordered_courses" : { "order" : [ "order" ] } }
    ]
  }
}';
  $configs['rules_enroll_user_in_ordered_courses_when_complete'] = rules_import($rule);
  return $configs;
}