Shopware 6

Introduction

Boxalino Winning Interactions Platform provides many features Shopware6, like:

  1. Search As you Type (Autocomplete Flyout)

  2. Search result page with facets (refinement filters), pagination, and sorting

  3. PDP product recommendations (via subscriber event)

  4. Category Product-listing results (a.k.a. Navigation) with facets (refinement filters), pagination and sorting

  5. CMS element (e.g.: products or blog post) for any Layout Integration (with Boxalino Narrative block)

  6. Dynamic router (ex: for brand pages or landing pages)

to integrate Boxalino Winning Interactions Platform, you will need to use our 3 repositories:

Repository

Description

Usage

Repository

Description

Usage

exporter-shopware6
(deprecated)

a standard Shopware6 plugin responsible to export Shopware data to Boxalino

To be replaced with the Data Integration repository

data-integration-shopware6

a Shopware6 plugin responsible to export the Shopware data following the Boxalino Data Integration Data Structures

Install and update when Boxalino provides a new version

rtux-shopware

a standard Shopware6 plugin responsible to manage all the calls to Boxalino API for your front-end

Install and update when Boxalino provides a new version

rtux-integration-showpare

a sample (tutorial) Shopware6 plugin provided to examplified how to integrate Boxalino (you can either build your own from scratch or download (and rename namespace) it to have all default features active directly, but do not copy or clone, as it is your environment and should not be updated from our repo)

Use as inspiration or download (and rename namespace) to bootstrap all features (but do not copy or clone!) and then develop, maintain and extend by yourself

As per the diagram below, all the execution will be done from your integration plugin (which you will build based on the examples provided in rtux-integration-shopware).

Prerequisites:

The intent of integrating the Boxalino API on a Shopware 6 environment requires building a new repository/plugin in the Shopware6 project which will represent the Integration Layer.

There are two ways to do that:

  1. Step-by-step (recommended)

  2. All-at-once

Step-by-step (recommended):

In this case, you are not integrating the rtux-integration-shopware repository directly, you are simply using it as a reference and build the functionalities step-by-step by yourself.

Boxalino recommends this way as you have full control on what you do and it ensures you don’t implement any code that you don’t need (you can always add it later).

In this case, just create a new plugin from scratch, known as your project`s Integration Layer (ex: namespace Boxalino\RealTimeUserExperienceIntegration), as an empty Plugin (you will need it in the next step to have a place to declare your export interfaces).

Follow the official Shopware 6 guidelines for how to create a new plugin (ex: https://docs.shopware.com/en/shopware-platform-dev-en/how-to/indepth-guide-bundle/setup)

All-at-Once:

In this case, you download (and rename namespace) (BUT DO NOT COPY OR CLONE!) the rtux-integration-shopware as a basis for your plugin. This will automatically activate all the standard features of Boxalino (search, navigation, product recommendations, …).

Boxalino does not recommend this way unless you know you want to use all the standard features and want to accelerate the process to get one (or many) shop(s) up and running quickly.

1. Declare data integration services and run full export

Follow the steps described in the section: Setup for the Data Integration Layer.

In these steps, after adding and activating the data-integration-shopware6, you will configure its parameters and declare the required services.

Once this is done, you can integrate the Command Console services and run a full export.

2. Activate tracker

Follow the steps described in the section: Setup for the Framework Layer.

In these steps you will add and activate the rtux-shopware plugin, then you will configure its parameters and activate the configuration of the tracker.

3. Make API calls for any feature (search, recos, …) and render the response in your front-end with narrative templates

This section will greatly depends on whether you chose the Approach Step-By-Step or All-At-Once as described above.

Step-By-Step

Follow the steps described in the section: Building up the Integration Layer - Step-By-Step.

The process will vary depending on which feature you want to integrate (Search, Product Recommendations, …). However, they will always follow the same steps:

  1. Configure in Boxalino Admin

    1. the required Widget(s) in the first main view (you can save them with an empty strategy, it will simply mean that the products you will retrieve are not filtered or sorted in any special way).

    2. the required Layout Blocks for each template which is involved in the rendering of the feature

    3. the required Narratives for each required Widget(s) with the layout adapted to the

    4. then press the test button to test with parameter test=true (or publish to test with parameter test=false)

    5. and wait at least 5 minutes for the cache to refresh

  2. Integrate the code to make the call to the Narrative API

  3. Integrate the templates required to render the layout returned by the Narrative API

All-at-Once

Follow the steps described in the section: Building up the Integration Layer - All-at-once.

The process here is primarily to configure all the required Widgets, Layout Blocks, and Narratives in one shot as all the features will be activated at once. The steps for this in the Boxalino Admin are the same as described in the Step-By-Step approach.

Important comments

In order to make sure that your integration goes smoothly, please take good notice of the following points:

  1. Make sure that if you export your data in dev (vs prod), that you access the API with dev=true (vs false)

  2. Make sure that you download (and rename namespace) but do not copy or clone the rtux-integration-shopware repository, even if you chose the approach “All-at-Once”. The integration layer needs to be your environment that you extend / modify and maintain.

  3. Make sure that you do not call the API before you have configured the following aspects in the Boxalino Admin and have pressed test or publish:

    1. Widgets (in the main view, even if you leave the configuration of the widget strategy empty), otherwise, the system will throw an error because you are calling a non-existing widget

    2. Layout Blocks (that all the template you need have been configured in the Layout blocks, otherwise, you cannot create your Narratives (point c))

    3. Narratives connected to Widgets of point a, as without narratives configured for the widget, your API response will be empty

    4. Click Test (or Save&Test) and wait at least 5 minutes before using the API with the parameter test=true

    5. Publish and wait at least 5 minutes before using the API with the parameter test=false

Setup for the Data Integration Layer GitHub - boxalino/data-integration-shopware6: Boxalino Data Integration for Shopware6 with the use of the data-integration-doc-php library

  1. Add the plugin to your project via composer 

    1. composer require boxalino/data-integration-shopware6

  2. Activate the plugin (Shopware6 default)

    1.  ./bin/console plugin:refresh 

    2. ./bin/console plugin:install --activate --clearCache BoxalinoDataIntegration

  3. Log in your Shopware admin and configure the plugin with the configurations provided for your setup

    1. Shopware Admin >> Settings >> System >> Plugins >> Boxalino Data Integration

      1. If the plugin configurations are not displayed, they can be accessed via direct link: admin#/sw/plugin/settings/BoxalinoDataIntegration

    2. Set configuration per Sales Channel and disable the plugin where it is not in use. The Headless channel must have the plugin disabled. 

    3. Use the ? icon to get information on the configurations options or check https://github.com/boxalino/data-integration-shopware6/wiki/Configurations

    4. More information on the available data indexes available in the wiki https://github.com/boxalino/data-integration-shopware6/wiki/Data-Indexes

  4. Add the generic services to your Integration Layer
    You can skip this step if you chose the approach “All-at-Once” and want to keep the default services.

    1. the doc_product handler is the service responsible for the export of product information (as seen on rtux-integration-shopware/src/Resources/config/services/di/product.xml at 3.0.0 · boxalino/rtux-integration-shopware )

      1. has configured a series of property handlers for different data structure export (ex: categories, stock, price, translation properties, options, image, link etc)

    2. the doc_language handler will export the existing languages for the given sales channel (rtux-integration-shopware/src/Resources/config/services/di/language.xml at 3.0.0 · boxalino/rtux-integration-shopware )

    3. the doc_attribute handler will export information on your product attributes (rtux-integration-shopware/src/Resources/config/services/di/attribute.xml at 3.0.0 · boxalino/rtux-integration-shopware )

    4. the doc_attribute_value handler will export the facet options for the product attributes (rtux-integration-shopware/src/Resources/config/services/di/attribute_value.xml at 3.0.0 · boxalino/rtux-integration-shopware )

    5. the doc_order handler is the service responsible for exporting your order information (as seen on rtux-integration-shopware/src/Resources/config/services/di/order.xml at 3.0.0 · boxalino/rtux-integration-shopware )

    6. the doc_user handler will handle the SW6 logic for exporting user information (rtux-integration-shopware/src/Resources/config/services/di/user.xml at 3.0.2 · boxalino/rtux-integration-shopware )

  5. Integrate the Product Export Console Command service (as seen on rtux-integration-shopware/src/Resources/config/services/di/product-console.xml at 3.0.0 · boxalino/rtux-integration-shopware )

  6. Trigger a full data index

    1. ./bin/console boxalino:di:full:product

    2. More options for the full data index :https://github.com/boxalino/data-integration-shopware6/wiki/Integration:-Full

    3. You can review the status of the sync process Sync Request | Request REVIEW

Proceed with the Setup of the Framework Layer.

Setup for the Framework Layer https://github.com/boxalino/rtux-shopware/wiki

  1. Add the plugin to your project via composer 

    1. composer require boxalino/rtux-shopware

  2. Activate the plugin (Shopware 6 default): 

    1. ./bin/console plugin:refresh 

    2. ./bin/console plugin:install --activate --clearCache BoxalinoRealTimeUserExperience

  3. Log in your Shopware admin and configure the plugin with the configurations provided for your setup

    1. Shopware Admin >> Settings >> System >> Plugins >> Boxalino RTUX Framework for Shopware v6

      1. If the plugin configurations are not displayed, they can be accessed via direct link: admin#/sw/plugin/settings/BoxalinoRealTimeUserExperience

    2. Use the ? icon to get information on the configurations options or check https://github.com/boxalino/rtux-shopware/wiki/Configurations

  4. Due to the JS files in the plugin (tracker, Shopware6 CMS blocks, etc), a theme compilation might be required:

    1.  ./psh.phar administration:build or ./bin/build-administration.sh 

    2. ./psh.phar storefront:build or ./bin/build-storefront.sh

  5. In order to kick off your account, a full export is required.

  6. Continue with the “Integration of the Framework Layer” steps

Integration of the Framework Layer

The API request schema has a list of properties. One of the properties is the sort property.

  1. Review the sorting options desired for the project

    1. in the default guidelines, the generic Shopware6 sorting options are used (price, title, score) https://github.com/boxalino/rtux-integration-shopware/blob/2.5.2/src/Resources/config/services.xml#L31

  2. it is possible to declare new sorting options by following the Shopware6 guidelines on adding new sorting methods

    1. for ex: topseller https://github.com/boxalino/rtux-integration-shopware/blob/2.5.2/src/Resources/config/services.xml#L45

      1. the frontend label (for filter.sortTopseller ) must be added in your Shopware6 account

      2. the field it matches to (ex: bq_order_count_products_group_id_all_time) must exist in the data index

        1. this sample field bq_* are only available for production accounts, which go through our BigQuery ecosystem

Building up the Integration Layer - Step-By-Step

In this section, we described the building process of the integration layer with the approach described above as “Step-by-Step”.

  1. Create & activate an empty Shopware6 plugin skeleton in your project codebase by following your project practices: in custom/plugins or vendor path

  2. Follow the Setup for Data Integration Layer Shopware 6 | Setup for the Data Integration Layer [inlineCard]

  3. Follow the Setup for Framework Layer Shopware 6 | Setup for the Framework Layer https://github.com/boxalino/rtux shopware/wiki

The Boxalino API integration can start by following the recommended order :

  1. Home slider (ex: CMS context )

  2. PDP recommendations / Cross-selling (as seen PDP sample )

  3. Autocomplete (the recommended Javascript approach)

  4. Navigation (via Shopping Experience Layout)

  5. Search

  6. Dynamic pages (ex: brand pages)

Every integration feature consists of:

  1. Integration Description / About : an insight into the approach.

  2. Steps

  3. Layout Blocks JSON : default JSON element to be loaded in Intelligence Admin

  4. Narratives Layout JSON : default JSON elements to be loaded in Intelligence Admin

Building up the Integration Layer - All-At-Once

In this section, we present the building process of the integration layer with the approach described above as “All-At-Once”. This strategy is being described in the video tutorial Integrate your Shopware6 e-shop with the Boxalino API

  1. Create an empty Shopware6 plugin skeleton in your project codebase by following your project practices: in custom/plugins or vendor path

  2. From a project level, require & activate the Data Integration Layer and the Framework Layer

    1. composer require boxalino/rtux-shopware

    2. composer require boxalino/data-integration-shopware6

    3. ./bin/console plugin:refresh

    4. ./bin/console plugin:install --activate --clearCache BoxalinoDataIntegration BoxalinoRealTimeUserExperience

  3. Download the Boxalino Guidelines for the Integration Layer from the public repository

    1. we recommend to download the latest available tag

  4. Review the downloaded version composer.json

  5. From the downloaded archive, extract the src folder

  6. From the src folder, delete the Shopware Plugin Class

    1. this file is specific to every plugin and your default/base Shopware6 Integration Layer Plugin already has one

  7. Copy the src folder in your project`s Integration Layer

    1. by doing so, you are merging the content of the Integration Guidelines in your own code-base

    2. if your project does not require the extended features (ex: Instant Update ) - disable it`s load by commenting this imported XML

    3. (optional) replace the /src/Resources/config/plugin.png with your agency`s icon or remove it

  8. Change the namespace by:

    1. replacing Boxalino\RealTimeUserExperienceIntegration with your own project`s Integration Layer namespace

  9. Install and Activate your project`s Integration Layer plugin (Shopware6 command)

  10. Re-compile the theme (administration and frontend)

    1. ./bin/build-administration.sh

    2. ./bin/build-storefront.sh

  11. Configure the Data Integration Layer and Framework Layer in Shopware 6 admin

    1. check out the Data Integration Layer Configurations wiki https://github.com/boxalino/data-integration-shopware6/wiki/Configurations

      1. set the DI configuration per Sales Channel and disable the plugin where it is not in use

      2. the Headless channel must have the plugins disabled

    2. check out the Framework Layer Configurations wiki https://github.com/boxalino/rtux-shopware/wiki/Configurations

  12. Run the data exporter command in order to initialize your account`s data index

    1. ./bin/console boxalino:di:full:product

    2. each repository has it`s own individual logger handler; the logs are saved in boxalino-di-<type>-<env>.log files

    3. read more on the available data indexes on the SOLR data indexes wiki page https://github.com/boxalino/data-integration-shopware6/wiki/Data-Indexes

    4. you can review the status of the SOLR sync with the use of our open API Sync Request | Request REVIEW

  13. Load the Narrative JSON Guidelines in Boxalino Intelligence Admin

    1. ask Boxalino on the setup channel to assist

      1. provide your project`s Integration Layer namespace

    2. do it yourself

      1. check out the JSON Guidelines page https://github.com/boxalino/rtux-integration-shopware/wiki/JSON-Guidelines-(Complete)

      2. copy each JSON content in the required path from Boxalino Intelligence Admin

        1. Menu: Advanced >> Template Resources

          1. copy and load as they are

        2. Menu: Merchandising >> Facets

          1. copy and load as they are

        3. Menu: Marketing >> Layout Block

          1. copy the JSON structure

          2. replace the @BoxalinoRealTimeUserExperienceIntegration namespace with your project`s Integration Layer namespace

          3. load in Boxalino Intelligence Admin

        4. Menu: Marketing >> Narratives

          1. copy and load as they are

        5. Menu: Strategies >> Touch Point Optimizers >> Search block >> click on the search widget

          1. copy, import and save&test as they are

  14. Per Shopware6 layout-strategy, the category uses the Shopping Experiences layouts. In order to enable navigation and edit the home page - new layouts with the narrative CMS block must be created.

    1. check out https://boxalino.atlassian.net/wiki/spaces/BPKB/pages/354877485 Configurations and Practices

 

Integration Review