This section describes how the module maps categories to Shopware and what configuration options are available.
The following subsections are involved in mapping categories:
Mapping categories is a complex process in the output module. There are two main subsections involved:
category-treebuilds and compares the category trees from synQup and Shopware
categorysynchronizes the category trees and then upserts each category
You can find more information on what each subsection does below (see "How Categories are Mapped").
The following configuration is used for categories:
Setting a Default Layout
You can set a default layout for your categories via configuration:
defaultLayoutShopwareIdcontains an uuid of a
cms_pagefrom Shopware. This is the layout to which each category will be assigned to during the initial import.
overwriteShopwareLayoutIddetermines whether a layout set manually in the administration will be replaced by the uuid from
Using a Custom Root Category
- By default, the root-transfer-category will be imported as a "level 1 category" (= as one of the root categories of shopware)
- The field
rootCategoryShopwareIddefines the id of a category, under which all transfer categories will be imported
Background - How Categories are Mapped
The process of mapping categories to Shopware can be confusing at first sight. Therefore, it is broken down in detail here.
First thing to understand is that there are three steps necessary in order to map categories from synQup to Shopware:
- Category Tree: Build and compare the category trees from Shopware and synQup
- Synchronize Trees: Execute operations to synchronize the Shopware category tree with your transfer categories
- Category Upserts: Upsert each category document individually
The steps are explained in detail in the following sections.
Step 1: Build and Compare Category Trees
Before the module is able to upsert categories to Shopware is has to generate and compare the category trees from Shopware and synQup. This is handled by the following subsections:
category-tree-shopbuilds a tree from the categories in Shopware
category-tree-transferbuilds a tree from the categories in synQup
category-tree-comparecompares both category trees
In the subsection
category-tree-compare the module derives operations to synchronize the existence of categories between synQup and
Shopware. The generated operations are executed in the subsection
category-operations eventually (see step 2).
Step 2: Synchronize Category Trees
The next step is to execute the operations to synchronize the category trees. The following subsections are involved:
category-operations-movemoves a category to another parent within its tree
category-operations-refresh-shop-treerebuilds the category tree as soon as all move-operations are done
category-operations-deleteremoves a category from Shopware
category-operations-addadds categories to Shopware
category-operations-rebuild-shop-treerebuilds the category tree as soon as all add- and delete-operations are done
category-operations-sort-categoriessynchronizes the order of categories
The operations executed in step 2 are only responsible to synchronize the existence of categories between synQup and Shopware. An
ADD-operation only creates a very simple category that does fully not represent its source document (
Category) yet. This
will be done in the next subsection:
At first glance, it seems unnecessarily complicated that categories might be sent to Shopware twice:
- As a sync-operation in the subsection
- As an upsert-request in the subsection
The reason for this is that a category, that has been updated in synQup (e.g. by updating its name), is not necessarily sent as
tree-operation (the structure of the trees is not affected by changing names). So an update of a name must be handled in the
If the structure of the trees did not change this subsection does not do anything at all.
Step 3: Upsert Categories
In this step all category-data will be mapped from synQup to Shopware. This is done by the following subsections: