diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90ab6df0..4eb5db0e 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
## Unreleased
+### Add
+- Add support for Atlas AI
+
### Change
- Upgrade Web Components version to v5.3.0
diff --git a/README.md b/README.md
index 17df6358..7e1937ed 100755
--- a/README.md
+++ b/README.md
@@ -137,6 +137,7 @@ Note: Sending each request to FACT-Finder instance trough Shopware, you lose on
* Add cart button - select this option if you want the Add to cart button on the product list
* Scenario how to count single click on "Add to cart" button
* Redirect mapping for selected queries - put each pair `query=url` in separate row. If the phrase appears twice, the first one from the top of the list will be taken. Url can be relative path `/some/page` or absolute url `https://domain.com/some/page?someParameter=1`. If provided pair has an invalid format then it will be ignored.
+* Atlas AI support - If Atlas AI support is enabled, the integration handles Atlas AI-specific requirements automatically. This includes creating a dedicated Atlas AI user ID and storing it on the client side across sessions. **Important: If you enable this function, userId will be generated automatically and the previous values for userId that were sent for logged-in users will be overwritten.**
#### Server Side Rendering
That option enables Server Side Rendering (SSR) for `ff-record-list` element on category and search result pages.
diff --git a/docs/assets/advanced-settings.png b/docs/assets/advanced-settings.png
index 3b0f3d6e..21445799 100644
Binary files a/docs/assets/advanced-settings.png and b/docs/assets/advanced-settings.png differ
diff --git a/spec/Subscriber/ConfigurationSubscriberSpec.php b/spec/Subscriber/ConfigurationSubscriberSpec.php
index e68d78e0..f927a841 100644
--- a/spec/Subscriber/ConfigurationSubscriberSpec.php
+++ b/spec/Subscriber/ConfigurationSubscriberSpec.php
@@ -69,6 +69,7 @@ public function it_will_return_factfinderchannel_for_specific_sales_channel_id(
$communication->isSsrActive()->willReturn(false);
$communication->isProxyEnabled()->willReturn(false);
$communication->isCartBtnEnabled()->willReturn(false);
+ $communication->supportAtlasAi()->willReturn(false);
$communication->getFactFinderFeatures()->willReturn([]);
$communication->getChannel('main_sales_channel')->willReturn('some_ff_channel');
$communication->getFieldRoles(Argument::any())->willReturn([]);
@@ -117,6 +118,7 @@ public function it_will_add_page_extension_for_storefront_render_event(
$communication->isSsrActive()->willReturn(false);
$communication->isProxyEnabled()->willReturn(false);
$communication->isCartBtnEnabled()->willReturn(false);
+ $communication->supportAtlasAi()->willReturn(false);
$event->getRequest()->willReturn($request);
$request->get('_route', Argument::any())->willReturn('factfinder');
$request->getLocale()->willReturn('en');
@@ -160,6 +162,7 @@ public function it_will_throw_exception_when_event_does_not_have_page(
$communication->isSsrActive()->willReturn(false);
$communication->isProxyEnabled()->willReturn(false);
$communication->isCartBtnEnabled()->willReturn(false);
+ $communication->supportAtlasAi()->willReturn(false);
$event->getRequest()->willReturn($request);
$request->get('_route', Argument::any())->willReturn('factfinder');
$request->getLocale()->willReturn('en');
diff --git a/src/Config/Communication.php b/src/Config/Communication.php
index 88e684e3..2f31b181 100644
--- a/src/Config/Communication.php
+++ b/src/Config/Communication.php
@@ -71,6 +71,11 @@ public function isCartBtnEnabled(): bool
return (bool) $this->config('addCartBtn');
}
+ public function supportAtlasAi(): bool
+ {
+ return (bool) $this->config('atlasAiSupport');
+ }
+
public function getFactFinderFeatures(): array
{
return [
diff --git a/src/Resources/config/config.xml b/src/Resources/config/config.xml
index eefbc8d8..6925e139 100644
--- a/src/Resources/config/config.xml
+++ b/src/Resources/config/config.xml
@@ -78,6 +78,15 @@
false
+
+ atlasAiSupport
+
+
+ false
+ If Atlas AI support is enabled, the integration handles Atlas AI-specific requirements automatically. This includes creating a dedicated Atlas AI user ID and storing it on the client side across sessions. Important: If you enable this function, userId will be generated automatically and the previous values for userId that were sent for logged in users will be overwritten.
+ Wenn die Atlas AI-Unterstützung aktiviert ist, kümmert sich die Integration automatisch um die Atlas AI-spezifischen Anforderungen. Dazu gehört die Erstellung einer dedizierten Atlas AI-Benutzer-ID und deren clientseitige Speicherung über mehrere Sitzungen hinweg. Wichtig: Wenn Sie diese Funktion aktivieren, wird die Benutzer-ID automatisch generiert und die zuvor für angemeldete Benutzer gesendeten Werte werden überschrieben.
+
+
trackingAddToCartCount
diff --git a/src/Resources/views/storefront/base.html.twig b/src/Resources/views/storefront/base.html.twig
index b4d0bced..6a365c83 100644
--- a/src/Resources/views/storefront/base.html.twig
+++ b/src/Resources/views/storefront/base.html.twig
@@ -16,17 +16,17 @@
apiKey: `{{page.extensions.factfinder.communication.apiKey}}`,
},
appConfig: {
- debug: true,
+ atlasAiMode: {{page.extensions.factfinder.communication.supportAtlasAi ? 'true' : 'false'}},
fieldRoles: {{ page.extensions.factfinder.field_roles|json_encode|raw }},
formatting: {
locale: `{{page.extensions.factfinder.communication.currencyCountryCode}}`,
formatOptions: {
style: `currency`,
currency: `{{page.extensions.factfinder.communication.currencyCode}}`,
+ },
+ },
},
- },
- },
- });
+ });
const ffRedirectMapping = JSON.parse('{{ page.extensions.factfinder.redirectMapping|raw }}');
diff --git a/src/Subscriber/ConfigurationSubscriber.php b/src/Subscriber/ConfigurationSubscriber.php
index 617b1a5f..4441877a 100755
--- a/src/Subscriber/ConfigurationSubscriber.php
+++ b/src/Subscriber/ConfigurationSubscriber.php
@@ -46,6 +46,7 @@ public function onPageLoaded(ShopwareSalesChannelEvent $event): void
'apiKey' => $this->config->getApiKey(),
'currencyCode' => $event->getSalesChannelContext()->getCurrency()->getIsoCode(),
'currencyCountryCode' => $event->getRequest()->getLocale(),
+ 'supportAtlasAi' => $this->config->supportAtlasAi(),
];
if (!empty($this->configurationAddParams)) {