Introduction

This page provides a general overview of all subsections of the media-module. This helps to understand what the module is doing in which phase of the mapping process.

Basically, the module is going through four phases in order to map media from synQup to Shopware:

  1. Sanity checks to ensure that the module can be executed at all
  2. Optional: Remove empty media entities from Shopware
  3. Analyze assets assigned to documents to identify the operations that need to be performed to synchronize your assets with Shopware
  4. Synchronize media to Shopware via API

Phases of the Media module

The phases run strictly one after the other. You can find more details about each phase below.

Phase 1: Sanity Checks

Sanity checks verify that the module can be executed successfully. This is done to prevent errors during the execution of the module, for example by checking the configured Shopware API integration or searching for configured languages in Shopware.

If a sanity check fails you will be notified. In that case the module stops its current execution by not finishing the subsection sanity-checks.

Phase 2: Remove Empty Media

The module is able to remove media-entities that do not contain a media file. They can occur due to errors in the file uploading process, third party plugins or manual misconfigurations in the administration panel.

Phase 3: Analyze Assets

In this phase the module is going to analyze all assets that are assigned to your documents. The module does analyze all assets from every document everytime it is executed, so the media assets from the transfer database are fully synchronized in each run. If an asset is already up-to-date in Shopware it will be left out.

The subsection analyze-assets contains two children: job-generation and update-progress. You can find out what each subsection does below.

Job Generation

In this subsection the module analyzes each Asset and compares it with its corresponding MediaEntity in Shopware (if already available). If a media file needs to be created, updated or deleted in Shopware the module generates a so called SyncMediaJob. Basically the module generates a collection of SyncMediaJobs for every document that contains assets and executes the generated operations in the corresponding sync-subsections (e.g. product-sync-create or product-sync-replace - see below for examples).

The progress of the sync-subsections is initialized during the job generation.

Progress Update

This is a very small subsection. After all jobs are generated this subsection cleans up subsections that have not been initialized in during the job-generation subsection. This is a subsection for internal progress management.

Synchronize Media (Phase 4)

This phase contains several subsections that are executed in parallel. The following subsections are executed for every document type:

  • media-{entity}-sync-create: Uploads a media file that is not existing in Shopware yet
  • media-{entity}-sync-replace: Replaces/Updates a media file in Shopware
  • media-{entity}-sync-delete: Removes a media file from Shopware
  • media-{entity}-sync-delete-shopware: Removes files that are only available in Shopware, but not in your assets (see media-deletion)
  • media-{entity}-sync-custom-fields: Synchronizes the attributes of an asset as custom fields to its corresponding media-entity
  • media-{entity}-sync-total: This subsection does only exist for a better overview, this is just a total count of all subsections mentioned above.

For products, there are two more subsections available: