function commerce_cart_field_attribute_eligible in Commerce Core 7
Determines whether or not the given field is eligible to function as a product attribute field on the Add to Cart form.
Parameters
$field: The info array of the field whose eligibility you want to determine.
Return value
TRUE or FALSE indicating the field's eligibility.
1 call to commerce_cart_field_attribute_eligible()
- commerce_cart_add_to_cart_form in modules/
cart/ commerce_cart.module - Builds an Add to Cart form for a set of products.
File
- modules/
cart/ commerce_cart.module, line 1561 - Implements the shopping cart system and add to cart features.
Code
function commerce_cart_field_attribute_eligible($field) {
// Returns TRUE if the field is single value (i.e. has a cardinality of 1) and
// is defined by a module implementing hook_options_list() to provide an array
// of allowed values structured as human-readable option names keyed by value.
return $field['cardinality'] == 1 && function_exists($field['module'] . '_options_list');
}