function course_uc_course_access_alter in Course 8.2
Same name and namespace in other branches
- 8.3 modules/course_uc/course_uc.module \course_uc_course_access_alter()
- 7.2 modules/course_uc/course_uc.module \course_uc_course_access_alter()
- 7 modules/course_uc/course_uc.module \course_uc_course_access_alter()
- 3.x 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 549
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']);
}
}