function commerce_registration_product_title in Commerce Registration 7.3
Same name and namespace in other branches
- 7 commerce_registration.module \commerce_registration_product_title()
- 7.2 commerce_registration.module \commerce_registration_product_title()
Product title line item callback.
We alter the title of the default line item to show available slots if the product is register enabled.
Parameters
CommerceLineItem $line_item: The line item to get the title for.
Return value
string Title of the line item product plus available slots, if applicable.
2 string references to 'commerce_registration_product_title'
- commerce_registration_commerce_line_item_type_info_alter in ./
commerce_registration.module - Implements hook_commerce_line_item_type_info_alter().
- commerce_registration_information_settings_form in includes/
commerce_registration.checkout_pane.inc - Commerce checkout pane settings form builder.
File
- ./
commerce_registration.module, line 150 - Commerce Registration module code.
Code
function commerce_registration_product_title($line_item) {
$wrapper = entity_metadata_wrapper('commerce_line_item', $line_item);
if (commerce_registration_product_has_registration_field($wrapper->commerce_product->product_id
->value())) {
return commerce_registration_get_product_title($wrapper->commerce_product
->value(), TRUE);
}
}