You are here

public function Shipment::getOriginalAmount in Commerce Shipping 8.2

Gets the original amount.

This is the amount before promotions and fees are applied.

Return value

\Drupal\commerce_price\Price|null The original amount, or NULL if unknown.

Overrides ShipmentInterface::getOriginalAmount

File

src/Entity/Shipment.php, line 317

Class

Shipment
Defines the shipment entity class.

Namespace

Drupal\commerce_shipping\Entity

Code

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