You are here

public function BundleItemOrderItem::getTotalPrice in Commerce Product Bundle 8

Gets the bundle item order item total price.

Return value

\Drupal\commerce_price\Price|null The order item total price, or NULL.

Overrides BundleItemOrderItemInterface::getTotalPrice

File

src/Entity/BundleItemOrderItem.php, line 136

Class

BundleItemOrderItem
Defines the Bundle Item Order Item entity.

Namespace

Drupal\commerce_product_bundle\Entity

Code

public function getTotalPrice() {
  if (!$this
    ->get('total_price')
    ->isEmpty()) {
    return $this
      ->get('total_price')
      ->first()
      ->toPrice();
  }
}