You are here

function commerce_product_line_item_title in Commerce Core 7

Returns an appropriate title for this line item.

File

modules/product_reference/commerce_product_reference.module, line 1314
Defines a field type for referencing products from other entities.

Code

function commerce_product_line_item_title($line_item) {

  // Currently, just return the product's title.  However, in the future replace
  // this with the product preview build mode.
  if ($product = entity_metadata_wrapper('commerce_line_item', $line_item)->commerce_product
    ->value()) {
    return check_plain($product->title);
  }
}