SalesRepresentative 1.3.0 Help

Installation

Diese Seite beschreibt das Aufsetzen des SalesRepresentative-Plugins in einer existierenden Shopware-6.7-Instanz. Shopware-Plugin-Grundwissen (plugin:refresh, plugin:install, Composer-Plugin-Format) wird vorausgesetzt.

Plugin-Quellen

Das Plugin wird als shopware-platform-plugin verteilt. Composer-Name: leoparden/sales-representative. PHP-Namespace: Leoparden\SalesRepresentative, Plugin-Klasse: Leoparden\SalesRepresentative\SalesRepresentative.

1. Plugin auschecken

Quelle nach custom/plugins klonen

  1. Wechsle in das Shopware-Root deiner Installation.

  2. git clone <repo-url> custom/plugins/SalesRepresentative
  3. Composer-Dependencies (leoparden/plugin-license-manager) werden vom Shopware-Plugin-Loader automatisch aufgelöst.

2. Installation und Aktivierung

Plugin registrieren

  1. bin/console plugin:refresh
  2. bin/console plugin:install --activate SalesRepresentative
  3. bin/console cache:clear

Die Aktivierung führt automatisch die Datenbank-Migrationen aus und legt die Custom-Fields, den Medienordner und den Mail-Template-Type an.

Angelegte Tabellen

  • leoparden_sales_representative — Vertreterprofil

  • leoparden_sales_representative_affiliate_code — AffiliateCodes je Vertreter

  • leoparden_sales_representative_customers — Junction Kunde ↔ AffiliateCode

  • leoparden_sales_representative_order_extra — Checkout-Daten je Warenkorb-Token

3. Custom-Fields und Medienordner

postInstall (bzw. update) erzeugt idempotent zwei Custom-Field-Sets über die DAL (custom_field_set.repository) — ein erneuter Lauf aktualisiert bestehende Felder, statt sie zu duplizieren:

Field-Set

Entität

Felder

leoparden_sales_representative

customer

..._field (Vertreterzuordnung), ..._orders_as_customer, ..._orders_as_representative, ..._can_use_customers_billing, ..._can_use_customers_shipping

leoparden_sales_representative_media

media

..._media_uploaded_by (welcher Vertreter das Bild hochgeladen hat)

Zusätzlich wird ein Medienordner „Sales Representatives" angelegt und seine ID in der SystemConfig unter salesRepresentativeDefaultMediaFolder hinterlegt. Existiert die Config bereits, wird der vorhandene Ordner wiederverwendet.

4. Mail-Template

Für die Kunden-Einladung wird der Mail-Template-Type sales_representative_mail registriert (verfügbare Entities: customer, salesRepresentative). Das zugehörige Flow-Event ist Leoparden\SalesRepresentative\Core\Framework\Event\CustomerInviteEvent und im Flow Builder als Auslöser nutzbar.

5. SystemConfig

Im Admin unter Einstellungen → System → Plugins → SalesRepresentative:

Schlüssel

Default

Bedeutung

customersCanAddRepresentativeViaAffiliateCode

aus

Erlaubt die Erst-Zuordnung eines Kunden zu einem Vertreter über den AffiliateCode-URL-Parameter

customersCanModifyRepresentativeViaAffiliateCode

aus

Erlaubt den Wechsel eines bereits zugeordneten Kunden zu einem anderen Vertreter über den URL-Parameter

salesRepresentativeDefaultMediaFolder

(bei Install gesetzt)

Medienordner für hochgeladene Vertreter-Profilbilder

6. Frontend-Assets

Im Storefront-/Admin-Mode müssen die Bundle-Assets gebaut werden (aus dem Shopware-Root):

composer build:js:storefront composer build:js:admin

7. Validierung

bin/console plugin:list | grep SalesRepresentative # → Installed: Yes, Active: Yes bin/console debug:router | grep -iE "sales.?representative" # → frontend.sales_representative.* + store-api.* Routes mysql -e "SHOW TABLES LIKE 'leoparden_sales_representative%'" shopware # → 4 Tabellen

Deinstallation

bin/console plugin:uninstall SalesRepresentative
Last modified: 10 August 2026