diff --git a/src/Model/Config/NostoConfigService.php b/src/Model/Config/NostoConfigService.php index 7e567d94..5f644982 100644 --- a/src/Model/Config/NostoConfigService.php +++ b/src/Model/Config/NostoConfigService.php @@ -80,6 +80,8 @@ class NostoConfigService public const ENABLE_STORE_ABANDONED_CART_DATA = 'storeAbandonedCartData'; + public const ENABLE_IGNORE_COOKIE_CONSENT = 'ignoreCookieConsent'; + public const DAILY_PRODUCT_SYNC_ENABLED = 'dailySynchronization'; public const DAILY_PRODUCT_SYNC_TIME = 'dailySynchronizationTime'; diff --git a/src/Model/ConfigProvider.php b/src/Model/ConfigProvider.php index 5ebc7b26..176a1db5 100644 --- a/src/Model/ConfigProvider.php +++ b/src/Model/ConfigProvider.php @@ -218,6 +218,15 @@ public function isEnabledReloadRecommendationsAfterAdding( ); } + public function isEnabledIgnoreCookieConsent($channelId = null, $languageId = null): bool + { + return $this->configService->getBool( + NostoConfigService::ENABLE_IGNORE_COOKIE_CONSENT, + $channelId, + $languageId, + ); + } + public function isEnabledProductLabellingSync(?string $channelId = null, ?string $languageId = null): bool { return $this->configService->getBool( diff --git a/src/Resources/app/administration/src/module/nosto/components/nosto-integration-features-flags/nosto-integration-features-flags.html.twig b/src/Resources/app/administration/src/module/nosto/components/nosto-integration-features-flags/nosto-integration-features-flags.html.twig index a5cb3860..c98cb084 100644 --- a/src/Resources/app/administration/src/module/nosto/components/nosto-integration-features-flags/nosto-integration-features-flags.html.twig +++ b/src/Resources/app/administration/src/module/nosto/components/nosto-integration-features-flags/nosto-integration-features-flags.html.twig @@ -348,6 +348,26 @@ {% endblock %} + {% block nosto_integration_feature_ignore_cookie_consent %} + + + + {% endblock %} + {% block nosto_integration_daily_synchronization_flag %} getResponse() instanceof StorefrontResponse)) { + if (!($event->getResponse())) { return; } @@ -59,7 +58,10 @@ public function onKernelResponse(ResponseEvent $event): void private function migrateOverdoseCookie(Response $response, Request $request): void { - if ($request->cookies->has(NostoCookieProvider::LEGACY_COOKIE_KEY)) { + if ( + $request->cookies->has(NostoCookieProvider::LEGACY_COOKIE_KEY) || + $this->configProvider->isEnabledIgnoreCookieConsent() + ) { $cookie = Cookie::create(NostoCookieProvider::LEGACY_COOKIE_KEY, '1', strtotime('-1 day')) ->withHttpOnly(false); $cookie->setSecureDefault($request->isSecure());