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(3mo ago)16.3k↓15.4%MITPHPCI passing

Since Mar 13Pushed 3mo 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 1mo ago

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

43

—

FairBetter than 91% of packages

Maintenance82

Actively maintained with recent releases

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

94d 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

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

92437.3k6](/packages/botman-driver-telegram)

PHPackages © 2026

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