Skip to content

Commit

Permalink
Add parcel template param
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekmajcher committed Feb 16, 2024
1 parent b7dd178 commit c11b114
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Api/WebClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ final class WebClient implements WebClientInterface

private string $labelType = 'normal';

public function __construct(Client $client, string $labelType)
private string $parcelTemplate = 'large';

public function __construct(Client $client, string $labelType, string $parcelTemplate)
{
$this->apiClient = $client;
$this->labelType = $labelType;
$this->parcelTemplate = $parcelTemplate;
}

public function setShippingGateway(ShippingGatewayInterface $shippingGateway): WebClientInterface
Expand Down Expand Up @@ -307,7 +310,7 @@ private function createParcel(ShipmentInterface $shipment): array
'unit' => 'kg',
],
'dimensions' => [],
'template' => 'large',
'template' => $this->parcelTemplate,
'tracking_number' => null,
'is_non_standard' => false,
];
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
bitbag.inpost.label_type: 'normal'
bitbag.inpost.parcel_template: 'large'
imports:
- { resource: "@BitBagSyliusInPostPlugin/Resources/config/services.xml" }
- { resource: "@BitBagSyliusInPostPlugin/Resources/config/resource/bitbag_inpost.yml" }
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
>
<argument type="service" id="sylius.http_client"/>
<argument>%bitbag.inpost.label_type%</argument>
<argument>%bitbag.inpost.parcel_template%</argument>
</service>

<service
Expand Down

0 comments on commit c11b114

Please sign in to comment.