You are here

function course_uc_restrict_qty_check_purchased in Course 6

Check if a user purchased a node previously.

1 call to course_uc_restrict_qty_check_purchased()
course_uc_restrict_qty_add_to_cart in modules/course_uc/course_uc.module
Implements hook_add_to_cart().

File

modules/course_uc/course_uc.module, line 165

Code

function course_uc_restrict_qty_check_purchased($uid, $nid) {
  $sql = "SELECT 1 FROM {uc_orders} uco\n  LEFT JOIN {uc_order_products} ucop ON (uco.order_id = ucop.order_id)\n  where uid = %d AND nid = %d";
  $purchased = db_result(db_query($sql, $uid, $nid));
  return $purchased;
}