Skip to content

Commit

Permalink
Merge branch 'release/4.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-memo-ict committed Aug 1, 2024
2 parents 9852ddb + 66c5a0b commit d08b290
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.1
- Fix an issue when reinstalling the plugin after updating to 4.x

# 4.0.0
#### Shopware compatibility update
- This version is compatible with Shopware 6.6.0 and higher.
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.1
- Behebung eines Problems bei der Neuinstallation des Plugins nach dem Update auf 4.x

# 4.0.0
#### Update der Shopware-Kompatibilität
- Diese Version ist kompatibel mit Shopware 6.6.0 und höher.
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_nl-NL.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.1
- Probleem opgelost bij het opnieuw installeren van de plugin na een update naar 4.x

# 4.0.0
#### Shopware compatibiliteit update
- Deze versie is compatibel met Shopware 6.5.2 en hoger.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "postnl/shopware6",
"description": "PostNL",
"type": "shopware-platform-plugin",
"version": "4.0.0",
"version": "4.0.1",
"license": "proprietary",
"authors": [
{
Expand Down
19 changes: 7 additions & 12 deletions src/Service/Shopware/ShippingMethodService.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function createShippingMethod(
'availabilityRuleId' => $ruleId,
'deliveryTimeId' => $deliveryTimeId,
'mediaId' => $mediaId,
'technicalName' => 'postnl_'.strtolower($deliveryType),
'technicalName' => $this->getTechnicalName($deliveryType),
'prices' => [
[
'calculation' => 1,
Expand All @@ -154,6 +154,11 @@ public function createShippingMethod(
return $id;
}

private function getTechnicalName(string $deliveryType): string
{
return 'postnl_'.strtolower($deliveryType);
}

/**
* @param string $deliveryType
* @param Context $context
Expand All @@ -163,7 +168,7 @@ public function createShippingMethod(
private function getShippingMethodForType(string $deliveryType, Context $context): ShippingMethodEntity
{
$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('customFields.' . Defaults::CUSTOM_FIELDS_KEY . '.deliveryType', $deliveryType));
$criteria->addFilter(new EqualsFilter('technicalName', $this->getTechnicalName($deliveryType)));

$shippingMethod = $this->shippingMethodRepository->search($criteria, $context)->first();

Expand Down Expand Up @@ -274,16 +279,6 @@ private function getMediaId(string $pluginDir, Context $context): string
return $icon->getId();
}

// Add icon to the media library
// $iconMime = 'image/svg+xml';
// $iconExt = 'svg';
// $iconPath = realpath(implode(DIRECTORY_SEPARATOR, [
// $pluginDir,
// '..',
// 'assets',
// 'postnl-logo-vector.svg'
// ]));

$iconMime = 'image/png';
$iconExt = 'png';
$iconPath = realpath(implode(DIRECTORY_SEPARATOR, [
Expand Down

0 comments on commit d08b290

Please sign in to comment.