You are here

function CourseObjectUbercart::take in Course 6

Same name and namespace in other branches
  1. 8.3 modules/course_uc/course_uc.classes.inc \CourseObjectUbercart::take()
  2. 8.2 modules/course_uc/course_uc.classes.inc \CourseObjectUbercart::take()
  3. 7.2 modules/course_uc/course_uc.classes.inc \CourseObjectUbercart::take()
  4. 7 modules/course_uc/course_uc.classes.inc \CourseObjectUbercart::take()

Overrides CourseObject::take

File

modules/course_uc/course_uc.classes.inc, line 16

Class

CourseObjectUbercart

Code

function take() {
  if ($this
    ->getFulfillment()
    ->isComplete()) {
    return "You've already purchased this activity.";
  }
  else {
    $atc = drupal_get_form('uc_product_add_to_cart_form', $this->node);
    if (!$atc) {

      // The add to cart form was hidden?
      return "Something isn't right...";
    }
    else {
      return $atc;
    }
  }
}