You are here

public function ProductVariation::getOrderItemTitle in Commerce Core 8.2

Gets the purchasable entity's order item title.

Saved in the $order_item->title field to protect the order items of completed orders against changes in the referenced purchased entity.

Return value

string The order item title.

Overrides PurchasableEntityInterface::getOrderItemTitle

File

modules/product/src/Entity/ProductVariation.php, line 271

Class

ProductVariation
Defines the product variation entity class.

Namespace

Drupal\commerce_product\Entity

Code

public function getOrderItemTitle() {
  $label = $this
    ->label();
  if (!$label) {
    $label = $this
      ->generateTitle();
  }
  return $label;
}