Skip to content

Commit 2ca4cf9

Browse files
Merge pull request #3 from AREA-NET-GmbH-Shopware-Agentur/main-6.7
Update auf Shopware 6.7
2 parents c04d615 + 22e8028 commit 2ca4cf9

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
All notable changes to this plugin will be documented in this file
33

44

5+
## [2.0.0] - 2025-11-19
6+
- Support for Shopware 6.7
7+
58
## [1.2.1] - 2025-03-11
69
- Bug: Incorrect service decoration: Shopware\Core\Checkout\Cart\Delivery\DeliveryBuilder
710

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ Delivery times are a decisive factor in your customers' purchasing decisions. In
88

99
## Unterstützte Shopware Versionen und Changelog
1010

11-
Stand 07.03.2025:
12-
- **6.5.8(.18) - 6.6.10.2**
11+
Stand 19.11.2025:
12+
- **6.5.8 - 6.7.4**
1313
- [CHANGELOG](AreanetBetterDeliveryTime/CHANGELOG.md)
1414
- [Download](https://github.com/AREA-NET-GmbH-Shopware-Agentur/shopware6-plugin-better-delivery-time/releases/)
1515

16-
Das Plugin wurde mit der letzten 6.5.8.18 getestet.
1716

1817
## Installation
1918

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "areanet/betterdeliverytime",
33
"description": "Better delivery time calculation",
4-
"version": "1.2.1",
4+
"version": "2.0.0",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
77
"autoload": {
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"shopware/core": "~6.5.0 || ~6.6.0"
19+
"shopware/core": "~6.5.0 || ~6.6.0 || ~6.7.0"
2020
},
2121
"extra": {
2222
"shopware-plugin-class": "AreanetBetterDeliveryTime\\AreanetBetterDeliveryTime",

src/Resources/config/services.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<service id="AreanetBetterDeliveryTime\Subscriber\ProductSubscriber" public="true">
1919
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService" />
20+
<argument type="service" id="delivery_time.repository"/>
2021
<tag name="kernel.event_subscriber"/>
2122
</service>
2223

src/Subscriber/ProductSubscriber.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
namespace AreanetBetterDeliveryTime\Subscriber;
44

5+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
6+
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
57
use Shopware\Core\System\SystemConfig\SystemConfigService;
68
use Shopware\Storefront\Page\Product\ProductPageLoadedEvent;
79
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
810

911
class ProductSubscriber implements EventSubscriberInterface
1012
{
1113
protected SystemConfigService $systemConfigService;
14+
protected EntityRepository $deliveryTimeRepository;
1215

13-
public function __construct(SystemConfigService $systemConfigService){
14-
$this->systemConfigService = $systemConfigService;
16+
public function __construct(SystemConfigService $systemConfigService, EntityRepository $deliveryTimeRepository){
17+
$this->systemConfigService = $systemConfigService;
18+
$this->deliveryTimeRepository = $deliveryTimeRepository;
1519
}
1620

1721
public static function getSubscribedEvents(): array
@@ -31,6 +35,11 @@ public function onProductPageLoaded(ProductPageLoadedEvent $event): void
3135
}
3236

3337
$deliveryTime = $salesChannelContext->getShippingMethod()->getDeliveryTime();
38+
if(!$deliveryTime){
39+
$deliveryTimeId = $salesChannelContext->getShippingMethod()->getDeliveryTimeId();
40+
$deliveryTime = $this->deliveryTimeRepository->search(new Criteria([$deliveryTimeId]), $salesChannelContext->getContext())->first();
41+
}
42+
3443
$page->getProduct()->setDeliveryTime($deliveryTime);
3544

3645
}

0 commit comments

Comments
 (0)