You are here

function commerce_discount_line_item_title in Commerce Discount 7

Determine the discount's line item title.

Return value

string The line item title.

1 string reference to 'commerce_discount_line_item_title'
commerce_discount_commerce_line_item_type_info in ./commerce_discount.module
Implements hook_commerce_line_item_type_info().

File

./commerce_discount.module, line 894
Defines the discount and discount offer entities, bundles and functionality.

Code

function commerce_discount_line_item_title($line_item) {
  $discount = entity_load_single('commerce_discount', $line_item->data['discount_name']);
  if (is_object($discount) && !empty($discount->component_title)) {
    return check_plain($discount->component_title);
  }
  return t('Fixed amount discount');
}