function course_uc_restrict_qty_check_cart in Course 6
Check if a node is in a user's cart.
1 call to course_uc_restrict_qty_check_cart()
- 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 176
Code
function course_uc_restrict_qty_check_cart($uid, $nid) {
$cid = !(is_null($cid) || empty($cid)) ? $cid : uc_cart_get_id();
$contents = uc_cart_get_contents($cid);
foreach ($contents as $item) {
if ($item->nid == $nid) {
return TRUE;
}
}
}