Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog
## Unreleased
### Add
- Add support for Atlas AI

### Change
- Upgrade Web Components version to v5.3.0

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file modified docs/assets/advanced-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions spec/Subscriber/ConfigurationSubscriberSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
5 changes: 5 additions & 0 deletions src/Config/Communication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
9 changes: 9 additions & 0 deletions src/Resources/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@
<defaultValue>false</defaultValue>
</input-field>

<input-field type="bool">
<name>atlasAiSupport</name>
<label>Atlas AI support</label>
<label lang="de-DE">Atlas AI-Unterstützung</label>
<defaultValue>false</defaultValue>
<helpText>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.</helpText>
<helpText lang="de-DE">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.</helpText>
</input-field>

<input-field type="single-select">
<name>trackingAddToCartCount</name>
<options>
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/views/storefront/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}');

Expand Down
1 change: 1 addition & 0 deletions src/Subscriber/ConfigurationSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Loading