You are here

public function ShippingMethodBase::getDefaultPackageType in Commerce Shipping 8.2

Gets the default package type.

Return value

\Drupal\commerce_shipping\Plugin\Commerce\PackageType\PackageTypeInterface The default package type.

Overrides ShippingMethodInterface::getDefaultPackageType

File

src/Plugin/Commerce/ShippingMethod/ShippingMethodBase.php, line 107

Class

ShippingMethodBase
Provides the base class for shipping methods.

Namespace

Drupal\commerce_shipping\Plugin\Commerce\ShippingMethod

Code

public function getDefaultPackageType() {
  $package_type_id = $this->configuration['default_package_type'];
  return $this->packageTypeManager
    ->createInstance($package_type_id);
}