function uc_termsofservice_condition_product_class in Ubercart Terms of Service 7
Same name and namespace in other branches
- 6 uc_termsofservice.ca.inc \uc_termsofservice_condition_product_class()
Checks that an order has a product of the selected class.
See also
uc_termsofservice_condition_product_class_form()
2 string references to 'uc_termsofservice_condition_product_class'
- uc_termsofservice_ca_condition in ./
uc_termsofservice.rules.inc - Implements hook_ca_condition().
- uc_termsofservice_ca_predicate in ./
uc_termsofservice.rules.inc - Implements hook_ca_predicate().
File
- ./
uc_termsofservice.rules.inc, line 80 - Conditional Actions hooks and functions for the terms of service panes.
Code
function uc_termsofservice_condition_product_class($cart, $settings) {
foreach ($cart as $cart_item) {
if ($cart_item->nid) {
$type = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $cart_item->nid));
if (in_array($type, array_values($settings['class']), TRUE)) {
return TRUE;
}
}
}
return FALSE;
}