# Shopware 6.6.x – Menüpunkt im Backend (Marketing → Statistik) wird nicht angezeigt – Pluginstruktur korrekt?

**URL:** <https://forum.shopware.com/t/shopware-6-6-x-menuepunkt-im-backend-marketing-statistik-wird-nicht-angezeigt-pluginstruktur-korrekt/107047>\
**Category:** Shopware 6 (German)\
**Created:** [17. April 2025 um 08:16 UTC](https://forum.shopware.com/t/shopware-6-6-x-menuepunkt-im-backend-marketing-statistik-wird-nicht-angezeigt-pluginstruktur-korrekt/107047 "2025-04-17T08:16:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shopware14](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@shopware14](https://forum.shopware.com/u/shopware14)\
**Post date:** [17. April 2025 um 08:16 UTC](https://forum.shopware.com/t/shopware-6-6-x-menuepunkt-im-backend-marketing-statistik-wird-nicht-angezeigt-pluginstruktur-korrekt/107047/1 "2025-04-17T08:16:42Z")

</div>

Hallo zusammen,

ich arbeite mit Shopware **6.6.10.3** und möchte ein eigenes Plugin erstellen, das im Backend unter **„Marketing“** einen Menüpunkt **„Statistik“** anzeigt. Dieser Menüpunkt soll später eine eigene Seite mit Statistikinformationen enthalten.

Wir haben bereits mehrere funktionierende Plugins für Shopware entwickelt. Doch bei einem so einfachen Ziel wie einem eigenen Menüpunkt mit Seite im Backend kommen wir bei **Shopware 6.6.x** aktuell nicht weiter – obwohl:

- das Plugin korrekt installiert und aktiviert wird
- `build-administration.sh`, `assets:install` und `cache:clear` ausgeführt wurden
- kein Fehler im Plugin-Log oder in der Browser-Konsole erscheint

* * *

### 🔧 Ziel

Ein Plugin mit Menüpunkt im Bereich „Marketing“, der beim Klick eine einfache Backend-Seite mit Titel und Text anzeigt.

* * *

### 📁 Verwendete Plugin-Struktur

```auto
StatisticPlugin/
├── composer.json
└── src
    ├── StatisticPlugin.php
    └── Resources
        └── app
            └── administration
                └── src
                    └── module
                        └── statistic
                            ├── index.js
                            └── page
                                └── statistic
                                    └── index.js

```

* * *

### 📄 composer.json

```auto
{
  "name": "statistic-plugin/statistic-plugin",
  "description": "Statistik Plugin für Shopware 6.6.x",
  "version": "1.0.0",
  "type": "shopware-platform-plugin",
  "license": "MIT",
  "autoload": {
    "psr-4": {
      "StatisticPlugin\\": "src/"
    }
  },
  "extra": {
    "shopware-plugin-class": "StatisticPlugin\\StatisticPlugin",
    "label": {
      "de-DE": "Statistik Plugin",
      "en-GB": "Statistic Plugin"
    }
  },
  "require": {
    "shopware/core": "^6.6"
  }
}

```

* * *

### 📄 `src/StatisticPlugin.php`

```auto
<?php declare(strict_types=1);

namespace StatisticPlugin;

use Shopware\Core\Framework\Plugin;

class StatisticPlugin extends Plugin
{
}

```

* * *

### 📄 `src/Resources/app/administration/src/module/statistic/index.js`

```auto
import './page/statistic';

Shopware.Module.register('statistic', {
    type: 'plugin',
    name: 'statistic',
    title: 'Statistik',
    description: 'Statistikmodul für Marketing',
    color: '#ff9900',
    icon: 'regular-chart-bar',
    routes: {
        index: {
            component: 'statistic-page',
            path: 'index'
        }
    },
    navigation: [{
        id: 'statistic-menu',
        label: 'Statistik',
        color: '#ff9900',
        path: 'statistic.index',
        parent: 'sw-marketing',
        position: 100
    }]
});

```

* * *

### 📄 `src/Resources/app/administration/src/module/statistic/page/statistic/index.js`

```auto
const { Component } = Shopware;

Component.register('statistic-page', {
    template: `<sw-page>
        <template #smart-bar-header>
            <h2>Statistik Übersicht</h2>
        </template>
        <div class="sw-container">
            Willkommen auf der Statistik-Seite!
        </div>
    </sw-page>`
});

```

* * *

### 🧪 Nach der Installation ausgeführte Befehle:

```auto
bin/console plugin:refresh
bin/console plugin:install --activate StatisticPlugin
bin/console assets:install
bin/build-administration.sh
bin/console cache:clear

```

* * *

### ❌ Ergebnis

- **Kein Menüpunkt sichtbar** im Bereich „Marketing“
- **Kein Fehler** in der Konsole oder im Backend sichtbar
- **Kein Eintrag** unter „Erweiterungen“ (obwohl Plugin aktiv ist)

* * *

### ❓ Fragen

1. Gibt es in Shopware 6.6.x.x Besonderheiten beim Registrieren von eigenen Modulen?
2. Muss man zusätzliche Schritte beachten, um den Menüpunkt erscheinen zu lassen?
3. Gibt es eine funktionierende Minimalstruktur, an der man sich orientieren kann?

Vielen Dank für jede Unterstützung – wir drehen uns hier im Kreis, obwohl das Plugin technisch korrekt aufgebaut scheint.

---

<div class="post-metadata">

**Author:** ![Anotherone](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Anotherone](https://forum.shopware.com/u/Anotherone)\
**Post date:** [18. April 2025 um 22:15 UTC](https://forum.shopware.com/t/shopware-6-6-x-menuepunkt-im-backend-marketing-statistik-wird-nicht-angezeigt-pluginstruktur-korrekt/107047/2 "2025-04-18T22:15:13Z")

</div>

Hat mich echt ein paar Nerven gekostet, aber anscheinend hat Shopware ein Problem mit dem einteiligen Modulnamen, es erwartet anscheinend mindestens einen zweiteiligen Namen. Denn das hier funktioniert

```auto
Shopware.Module.register('stat-istic', {
    type: 'plugin',
    name: 'stat-istic',
    title: 'Hurz',
    description: 'description',

    routes: {
        index: {
            component: 'stat-istic-index',
            path: 'index'
        }
    },

    navigation: [
        {
            id: 'stat-istic',
            icon: 'regular-megaphone',
            color: '#FFD700',
            path: 'stat.istic.index',
            label: 'Statistik',
            parent: 'sw-marketing',
        },
    ]
});

```

das hier dagegen nicht

```auto
Shopware.Module.register('statistic', {
    type: 'plugin',
    name: 'statistic',
    title: 'Hurz',
    description: 'description',

    routes: {
        index: {
            component: 'statistic-index',
            path: 'index'
        }
    },

    navigation: [
        {
            id: 'statistic',
            icon: 'regular-megaphone',
            color: '#FFD700',
            path: 'statistic.index',
            label: 'Wein',
            parent: 'sw-marketing',
        },
    ]
});

```

---

<div class="post-metadata">

**Author:** ![shopware14](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@shopware14](https://forum.shopware.com/u/shopware14)\
**Post date:** [19. April 2025 um 09:14 UTC](https://forum.shopware.com/t/shopware-6-6-x-menuepunkt-im-backend-marketing-statistik-wird-nicht-angezeigt-pluginstruktur-korrekt/107047/3 "2025-04-19T09:14:16Z")

</div>

Danke für den Hinweis! Der Punkt mit der `main.js` ist auf jeden Fall wichtig.

Das große Problem bei mir war aber die falsche Platzierung der main.js-Datei.  
Ich hatte die Datei ursprünglich unter  
StatisticPlugin/src/Resources/app/administration/main.js  
statt wie erforderlich unter  
StatisticPlugin/src/Resources/app/administration/src/main.js.

Nur wenn die main.js exakt in diesem Verzeichnis liegt und z. B. so aufgebaut ist:

> import ‚./module/statistic-plugin‘;

…dann wird das Admin-Modul korrekt eingebunden. Der Pfad ./module/statistic-plugin muss dabei natürlich zu einem existierenden Verzeichnis führen, das index.js und ggf. weitere Komponenten enthält.

In meinem Fall war die komplette Struktur am Ende so aufgebaut:

```auto
> StatisticPlugin/
> ├── composer.json
> └── src
> ├── StatisticPlugin.php
> └── Resources
> └── app
> └── administration
> └── src
> ├── main.js
> └── module
> └── statistic-plugin
> ├── index.js
> └── page
> ├── statistic-plugin-page.js
> └── statistic-plugin-page.html.twig

```

Seit der Korrektur funktioniert der Menüpunkt wie erwartet.
