Introduction
This page explains how the mapping-extension identifies documents and Shopware entities.
The way documents and their corresponding Shopware entities are linked is a different from the main module. The method of writing the identifier of a document to custom fields in Shopware is not used by the mapping-extension. It cannot be guaranteed that all plugin tables implement custom fields. This is why the module calculates the unique identifiers (UUIDs) to use in Shopware before sending documents to Shopware. The way how this is done can be configured by setting the primary key mode in the configuration.
Primary Key Modes
There are two primary key modes available which can be set in the primaryKeyMode
field in the configuration:
{
"primaryKeyMode": "identifier || id",
"mappings": [
{
"primaryKeyMode": "identifier || id",
"...": "..."
}
]
}
The first value sets a default global primary key mode. You can also override this value individually for each mapping configuration.
Identifier Mode
The identifier
mode is the default mode if nothing is specified. In this case the mapping-extension will generate an UUId for the
Shopware entity by converting the identifier of the source document into a Shopware UUID. It is highly recommended to use this mode.
Object Id Mode (Default)
The id
mode is usable for source objects that do not have identifiers. It is highly recommended to add identifiers to your
documents though. The extension will convert the object id of the source document into a Shopware UUID. This means that a changed
ObjectId of your source document will produce a duplicate in the shop.