You are here

public function FlatRate::__construct in Commerce Shipping 8.2

Constructs a new FlatRate object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\commerce_shipping\PackageTypeManagerInterface $package_type_manager: The package type manager.

\Drupal\state_machine\WorkflowManagerInterface $workflow_manager: The workflow manager.

Overrides ShippingMethodBase::__construct

File

src/Plugin/Commerce/ShippingMethod/FlatRate.php, line 37

Class

FlatRate
Provides the FlatRate shipping method.

Namespace

Drupal\commerce_shipping\Plugin\Commerce\ShippingMethod

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, PackageTypeManagerInterface $package_type_manager, WorkflowManagerInterface $workflow_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $package_type_manager, $workflow_manager);
  $this->services['default'] = new ShippingService('default', $this->configuration['rate_label']);
}