You are here

public function Shipment::getTrackingCode in Commerce Shipping 8.2

Gets the shipment tracking code.

Only available if shipping method supports tracking and the shipment itself has been shipped.

Return value

string|null The shipment tracking code, or NULL if unknown.

Overrides ShipmentInterface::getTrackingCode

File

src/Entity/Shipment.php, line 426

Class

Shipment
Defines the shipment entity class.

Namespace

Drupal\commerce_shipping\Entity

Code

public function getTrackingCode() {
  return $this
    ->get('tracking_code')->value;
}