PHPackages                             de-swebhosting-shopware-plugin/smart-relation-sync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. de-swebhosting-shopware-plugin/smart-relation-sync

ActiveShopware-platform-plugin[API Development](/categories/api)

de-swebhosting-shopware-plugin/smart-relation-sync
==================================================

Smart relation handling for the Sync-API

v2.0.0(4mo ago)18.3k↓38.5%MITPHPCI passing

Since Mar 13Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/astehlik/shopware-plugin-smart-relation-sync)[ Packagist](https://packagist.org/packages/de-swebhosting-shopware-plugin/smart-relation-sync)[ RSS](/packages/de-swebhosting-shopware-plugin-smart-relation-sync/feed)WikiDiscussions main Synced yesterday

READMEChangelog (9)Dependencies (14)Versions (15)Used By (0)

Shopware SmartRelationSync Plugin
=================================

[](#shopware-smartrelationsync-plugin)

The goal of this Plugin is to ease the pain of dealing with relations in Shopware.

Shopware native
---------------

[](#shopware-native)

Before explaining the solution in this Plugin, please be aware that there is a Shopware native way in the Sync-API to archive the same result. For example to assign a new category, you can send the following HTTP request:

```
POST /api/_action/sync
Content-Type: application/json

{
    "change-category": {
        "entity": "product",
        "action": "upsert",
        "payload": [
            {
                "id": "",
                "categories": [
                    {"id": ""}
                    {"id": ""}
                ]
            }
        ]
    },
    "delete-obsolete": {
        "entity": "product_category",
        "action": "delete",
        "criteria": [
            {
                "type": "equals",
                "field": "productId",
                "value": ""
            },
            {
                "type": "not",
                "operator": "and",
                "queries": [
                    {
                        "type": "equalsAny",
                        "field": "categoryId",
                        "value": ["", ""]
                    }
                ]
            }
        ]
    }
}
```

Quick start
-----------

[](#quick-start)

After installing the Plugin, you can enable automatic relation cleanup in the DAL or in the Sync-API, for example:

```
$productData = [
    'id' => '...',
    'categories' => [['id' => '...']],
    'categoriesCleanupRelations' => true,
];
$this->productRepository->upsert([$productData], $context);
```

```
POST /api/_action/sync
Content-Type: application/json

{
    "write-product": {
        "entity": "product",
        "action": "upsert",
        "payload": [
            {
                "id": "...",
                "categories": [{ "id": "..." }],
                "categoriesCleanupRelations": true
            }
        ]
    }
}
```

By setting `categoriesCleanupRelations` to `true`, the plugin will automatically remove all category relations that are not in the given array.

You can do this for any many-to-many or one-to-many relation with the `CleanupRelation` suffix.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance74

Regular maintenance activity

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~75 days

Total

9

Last Release

139d ago

Major Versions

v0.3.0 → v1.0.02025-04-16

v1.1.2 → v2.0.02026-02-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/956513?v=4)[Alexander Stehlik](/maintainers/astehlik)[@astehlik](https://github.com/astehlik)

---

Top Contributors

[![astehlik](https://avatars.githubusercontent.com/u/956513?v=4)](https://github.com/astehlik "astehlik (37 commits)")

---

Tags

shopwareshopware-pluginshopware6-pluginshowpare6

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/de-swebhosting-shopware-plugin-smart-relation-sync/health.svg)

```
[![Health](https://phpackages.com/badges/de-swebhosting-shopware-plugin-smart-relation-sync/health.svg)](https://phpackages.com/packages/de-swebhosting-shopware-plugin-smart-relation-sync)
```

###  Alternatives

[shopware/storefront

Storefront for Shopware

684.6M236](/packages/shopware-storefront)[shopware/production

177209.0k](/packages/shopware-production)[frosh/tools

Provides some basic things for managing the Shopware Installation

87820.7k3](/packages/frosh-tools)[shopware/administration

Administration frontend for the Shopware Core

414.3M116](/packages/shopware-administration)[shopware/elasticsearch

Elasticsearch for Shopware

153.9M19](/packages/shopware-elasticsearch)[adyen/adyen-shopware6

Official Shopware 6 Plugin to connect to Payment Service Provider Adyen

25117.9k](/packages/adyen-adyen-shopware6)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
