From bdfebbec8ce941a36f96409b06ca23336d23733a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20M=C3=BCller?= <25648755+M-arcus@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:49:59 +0200 Subject: [PATCH] Add SalesChannelContext to CleverPushWorkerJsController --- src/Storefront/Controller/CleverPushWorkerJsController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Storefront/Controller/CleverPushWorkerJsController.php b/src/Storefront/Controller/CleverPushWorkerJsController.php index bc7a921..5faf360 100644 --- a/src/Storefront/Controller/CleverPushWorkerJsController.php +++ b/src/Storefront/Controller/CleverPushWorkerJsController.php @@ -3,6 +3,7 @@ namespace CleverPush\CleverPushShopware\Storefront\Controller; use Shopware\Core\PlatformRequest; +use Shopware\Core\System\SalesChannel\SalesChannelContext; use Shopware\Core\System\SystemConfig\SystemConfigService; use Shopware\Storefront\Controller\StorefrontController; use Shopware\Storefront\Framework\Routing\StorefrontRouteScope; @@ -20,9 +21,9 @@ public function __construct(SystemConfigService $systemConfigService) } #[Route(path: '/cleverpush-worker.js', name: 'frontend.cleverpush.worker', defaults: ['_httpCache' => true], methods: ['GET'])] - public function showCleverPushWorkerJs(): Response + public function showCleverPushWorkerJs(SalesChannelContext $salesChannelContext): Response { - $channelId = trim($this->systemConfigService->getString('CleverPushShopwarePlugin.config.channelId')); + $channelId = trim($this->systemConfigService->getString('CleverPushShopwarePlugin.config.channelId', $salesChannelContext->getSalesChannelId())); $content = 'console.log(\'CleverPush Channel ID is not configured.\');'; if ($channelId !== '' && $channelId !== '0') {