# Freitextfeld Ausgabe Hauptartikel

**URL:** https://forum.shopware.com/t/freitextfeld-ausgabe-hauptartikel/90190
**Category:** Programmierung
**Created:** [8. September 2021 um 09:31 UTC](https://forum.shopware.com/t/freitextfeld-ausgabe-hauptartikel/90190 "2021-09-08T09:31:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pulveblei-shop](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@pulveblei-shop](https://forum.shopware.com/u/pulveblei-shop)
#### Post date: [8. September 2021 um 09:31 UTC](https://forum.shopware.com/t/freitextfeld-ausgabe-hauptartikel/90190/1 "2021-09-08T09:31:31Z")

</div>

Hi,

ich benutze folgenden Code in einem Plugin

```auto
            $articleAttr19 = '';
            if ($product !== null) {
                $attributes = $product->getAttribute();
                if (!empty($attributes)) {
               $articleAttr19 = $attributes->getAttr19();
                }
            }

```

Ist es möglich die so anzupassen, das nur den Inhalt des Hauptartikels auszugeben wird?

Gruß Benjamin

---

<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: [8. September 2021 um 11:45 UTC](https://forum.shopware.com/t/freitextfeld-ausgabe-hauptartikel/90190/2 "2021-09-08T11:45:49Z")

</div>

Der Code sieht für mich eher wie Shopware 5 aus.

Unabhängig davon verstehe ich deine Frage nicht.

---

<div class="post-metadata">

### Author: ![pulveblei-shop](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@pulveblei-shop](https://forum.shopware.com/u/pulveblei-shop)
#### Post date: [8. September 2021 um 12:14 UTC](https://forum.shopware.com/t/freitextfeld-ausgabe-hauptartikel/90190/3 "2021-09-08T12:14:12Z")

</div>

Jup, Shopware 5.

Aktuell werden mir Informationen aus der jeweiligen verwendeten Variante ausgegeben,  
die im Freitextfeld enthalten sind.

Ich würde gerne aber nur das Freitextfeld des Hauptartikel ausgeben wollen.

---

<div class="post-metadata">

### Author: ![phil](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/phil/32/13661_2.png) [@phil](https://forum.shopware.com/u/phil)
#### Post date: [8. September 2021 um 16:24 UTC](https://forum.shopware.com/t/freitextfeld-ausgabe-hauptartikel/90190/4 "2021-09-08T16:24:39Z")

</div>

Denke dann musst du vom aktuellen Artikel ausgehend erstmal über die `main_detail_id` den zugehörigen Hauptartikel besorgen, und dann halt die Attribute von diesem auslesen.

LG Phil
