You are here

public function ProductVariation::getListPrice in Commerce Core 8.2

Gets the list price.

Return value

\Drupal\commerce_price\Price The list price.

Overrides ProductVariationInterface::getListPrice

File

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

Class

ProductVariation
Defines the product variation entity class.

Namespace

Drupal\commerce_product\Entity

Code

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