# SW 5.2 eigenes Einkaufswelten Element Kategorien/Artikel Combo Box

**URL:** <https://forum.shopware.com/t/sw-5-2-eigenes-einkaufswelten-element-kategorien-artikel-combo-box/41446>\
**Category:** Programmierung\
**Created:** [17. November 2016 um 15:24 UTC](https://forum.shopware.com/t/sw-5-2-eigenes-einkaufswelten-element-kategorien-artikel-combo-box/41446 "2016-11-17T15:24:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![olai](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@olai](https://forum.shopware.com/u/olai)\
**Post date:** [17. November 2016 um 15:24 UTC](https://forum.shopware.com/t/sw-5-2-eigenes-einkaufswelten-element-kategorien-artikel-combo-box/41446/1 "2016-11-17T15:24:16Z")

</div>

Hallo zusammen

Zuerst einmal meine Ausgangslage.

Ich möchte ein eigenes Einkaufswelten Element erstellen, ähnlich wie das Kategorie-Teaser Element. Es wäre gedacht, dass man in dem Element ein Bild, ein Produkt oder eine Kategorie und einen Text wie z.B. „Mehr erfahren“, oder&nbsp;„Jetzt Grösse auswählen“ angeben kann. Das Element würde dann jeweils auf das Produkt oder die Kategorie Seite verlinken.

Hier [Custom shopping world elements](https://developers.shopware.com/developers-guide/custom-shopping-world-elements/#adding-configuration-fields-to-the-element) gibt es ja einen Guide mit einem Beispiel Element. Die createTextField und createMediaField Elemente funktionieren. Mein Problem liegt beim createComboBoxField Element.  
Ich habe im Edit Modals beim Klick auf das select Element den&nbsp;JS Error „Uncaught TypeError: Cannot read property ‚type‘ of undefined“ und habe keien Plan, woran das liegen könnte.

Ich bin mir auch&nbsp;nicht ganz sicher, ob der Store den ich für die Kategorien verwende ‚Shopware.apps.Base.store.Category‘ überhaupt die gleiche Ausgabe wie beim Kategorie-Teaser&nbsp;Element ausgeben würde, da es im Ajax Request nicht danach aussah.

Könnte mir da jemand weiterhelfen?

Habe hier auch noch die install Methode des Plugins.

```
public function install(InstallContext $context)
{
    $installer = $this->container->get('shopware.emotion_component_installer');

    $teaserElement = $installer->createOrUpdate(
        $this->getName(),
        'Hofer Teaser',
        [
            'name' => 'Hofer Teaser',
            'template' => 'emotion_teaser',
            'description' => 'Bild Teaser für Startseite'
        ]
    );

    $teaserElement->createMediaField(
        [
            'name' => 'teaser_image',
            'fieldLabel' => 'Teaser Bild',
            'allowBlank' => false
        ]
    );
    $teaserElement->createComboBoxField(
        [
            'name' => 'teaser_article_selection',
            'fieldLabel' => 'Artikel-Auswahl',
            'allowBlank' => true,
            'store' => 'Shopware.apps.Base.store.Article',
            'valueField' => 'teaser_article'
        ]
    );
    $teaserElement->createComboBoxField(
        [
            'name' => 'teaser_category_selection',
            'fieldLabel' => 'Kategorie-Auswahl',
            'allowBlank' => true,
            'store' => 'Shopware.apps.Base.store.Category',
            'valueField' => 'teaser_value'
        ]
    );
    $teaserElement->createTextField(
        [
            'name' => 'teaser_link_text',
            'fieldLabel' => 'Link Text',
            'supportText' => 'Der Text unter dem Bild',
            'allowBlank' => true
        ]
    );
}

```

Vielen Dank.

---

<div class="post-metadata">

**Author:** ![clex](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@clex](https://forum.shopware.com/u/clex)\
**Post date:** [17. August 2017 um 12:08 UTC](https://forum.shopware.com/t/sw-5-2-eigenes-einkaufswelten-element-kategorien-artikel-combo-box/41446/2 "2017-08-17T12:08:11Z")

</div>

Hi olai,

wenn ich dich richtig verstehe, stand ich vor dem selben Problem. Ich konnte es damit Lösen:

```
'valueField' => 'id',
'displayField' => 'name',
'store' => 'Shopware.apps.Category.store.CategoryPath'

```

das hat mir die Kategorien die der Category teaser zurückgegeben.  
Hoffe es hilft.

---

<div class="post-metadata">

**Author:** ![chrisBo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/chrisbo/32/19404_2.png) [@chrisBo](https://forum.shopware.com/u/chrisBo)\
**Post date:** [27. November 2017 um 20:58 UTC](https://forum.shopware.com/t/sw-5-2-eigenes-einkaufswelten-element-kategorien-artikel-combo-box/41446/3 "2017-11-27T20:58:43Z")

</div>

```
$teaserElement->createComboBoxField([
            'name' => 'category_selection',
            'fieldLabel' => 'Kategorie-Auswahl',
            'allowBlank' => true,
            'valueField' => 'id',
            'displayField' => 'name',
            'store' => 'Shopware.apps.Emotion.store.CategoryPath',
        ]);

```

&nbsp;
