function commerce_conditions_rules_condition_has_term in Commerce Extra Rules Conditions 7
Rule condition for checking if a line item has a product with a certain term id
Parameters
object $line_item: A commerce_line_item containing the product being checked
string $field_name: A string containing the machine name of a Taxonomy reference field
integer $term_id: An integer corresponding to a Taxonomy term id
Return value
TRUE if the product has the term applied to it on the field $field_name Otherwise FALSE
File
- ./
commerce_conditions.module, line 22 - Defines functions used for building and processing Rules conditions.
Code
function commerce_conditions_rules_condition_has_term($line_item, $field_name, $term_id) {
$field_name = trim($field_name);
return commerce_conditions_has_term($line_item, $field_name, $term_id);
}