# Neues Bild automatisiert allen Produkten hinzufügen

**URL:** https://forum.shopware.com/t/neues-bild-automatisiert-allen-produkten-hinzufuegen/91763
**Category:** Shopware 6 (German)
**Created:** [2. Dezember 2021 um 13:39 UTC](https://forum.shopware.com/t/neues-bild-automatisiert-allen-produkten-hinzufuegen/91763 "2021-12-02T13:39:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PromoID](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/promoid/32/14015_2.png) [@PromoID](https://forum.shopware.com/u/PromoID)
#### Post date: [2. Dezember 2021 um 13:39 UTC](https://forum.shopware.com/t/neues-bild-automatisiert-allen-produkten-hinzufuegen/91763/1 "2021-12-02T13:39:19Z")

</div>

Hat jemand eine schnelle und einfache Lösung für die Zuordnung der Medien?  
Wir haben ein neues Bild, welches jedem Artikel zugeordnet werden soll. Bei über 400 Produkten ist das halt sehr aufwendig. Hat jemand einen Tipp?

---

<div class="post-metadata">

### Author: ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)
#### Post date: [2. Dezember 2021 um 13:51 UTC](https://forum.shopware.com/t/neues-bild-automatisiert-allen-produkten-hinzufuegen/91763/2 "2021-12-02T13:51:43Z")

</div>

Per Command oder API lässt sich das per Schleife bewerkstelligen.

---

<div class="post-metadata">

### Author: ![PromoID](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/promoid/32/14015_2.png) [@PromoID](https://forum.shopware.com/u/PromoID)
#### Post date: [2. Dezember 2021 um 13:53 UTC](https://forum.shopware.com/t/neues-bild-automatisiert-allen-produkten-hinzufuegen/91763/3 "2021-12-02T13:53:17Z")

</div>

Hättest du einen Ansatz für mich wie das ganze per Command aussehen würde?

---

<div class="post-metadata">

### Author: ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)
#### Post date: [2. Dezember 2021 um 13:59 UTC](https://forum.shopware.com/t/neues-bild-automatisiert-allen-produkten-hinzufuegen/91763/4 "2021-12-02T13:59:52Z")

</div>

Command

> **[Add custom CLI commands](https://developer.shopware.com/docs/guides/plugins/plugins/plugin-fundamentals/add-custom-commands)**

Product Repository

> **[Writing data](https://developer.shopware.com/docs/guides/plugins/plugins/framework/data-handling/writing-data)**

Dann per Schleife das Bild zuordnen. Entweder über das entsprechenden – ich schätze MediaRepository – nach der ID suchen oder aus der Datenbank die ID manuell suchen und dann hartkodiert in die Schleife.
