You are here

function course_uc_course_access_alter in Course 3.x

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

Implements hook_course_access_alter().

If

  • Ubercart is enabled
  • This is a course product
  • Anonymous checkout is enabled

Then we can unset the requirement that users must be logged in (because we can assume that the account will be created).

File

modules/course_uc/course_uc.module, line 492

Code

function course_uc_course_access_alter(&$hooks, $op, $node, $account) {
  if ($op == 'enroll' && !empty($node->sell_price) && $node->sell_price > 0 && variable_get('uc_checkout_anonymous', 1)) {
    unset($hooks['course_noanon']);
  }
}