Custom Fields mit multi-select Entity

Hallo!

In einem Plugin möchte ich ein custom Field anlegen, wo ich mehere Kategorien z.B. auswählen kann. Als single-select kein Problem:

[
    'id' => Uuid::randomHex(),
    'name' => 'custom_field_foobar_categories',
    'type' => CustomFieldTypes::JSON,
    'config' => [
        'label' => [
            'en-GB' => 'Categories',
            'de-DE' => 'Kategorien'
        ],
        'componentName' => "sw-entity-single-select",
        'entity' => 'category',
        'customFieldType' => CustomFieldTypes::JSON,
        'customFieldPosition' => 3
    ],
    'customFieldSet' => ['id' => $fieldSetId]
];

Hier kann ich im Adminpanel eine Kategorie auswählen und diese wird auch gespeichert.

Als multi-select funktioniert das leider nicht:

[
    'id' => Uuid::randomHex(),
    'name' => 'custom_field_foobar_categories',
    'type' => CustomFieldTypes::JSON,
    'config' => [
        'label' => [
            'en-GB' => 'Categories',
            'de-DE' => 'Kategorien'
        ],
        'componentName' => "sw-entity-multi-select",
        'entityCollection' => 'category',
        'customFieldType' => CustomFieldTypes::JSON,
        'customFieldPosition' => 3
    ],
    'customFieldSet' => ['id' => $fieldSetId]
];

Ist die Eigenschaft 'entityCollection' => 'category' überhaupt richtig? Oder fehlt noch etwas anderes? Hab auch schon alle möglichen Kominationen mit entity und entityCollection ausprobiert.

 

niemand?

Probier mal sw-entity-multi-id-select statt sw-entity-multi-select.

Viele Grüße
https://www.digitvision.de

leider nein :confused:

Hast du Shopware 6.2? Mit Shopware 6.1 ist ein multi select noch nicht möglich.

Viele Grüße
https://www.digitvision.de

Habt ihr eine Lösung für die Ausgabe von Labels bei Multi-Select Custom Field ?? 

Bei Selectfelder bekomme ich nur die Technischer Name und nicht die Übersetzungen. 

https://issues.shopware.com/issues/NEXT-6932

Habt Ihr eine Lösung? Ich habe das gleiche Problem

Hier mal eine Lösung für alle, die über diesen Post stolpern.

'customFields' => [
                [
                    'name' => 'signal',
                    'type' => CustomFieldTypes::JSON,
                    'config' => [
                        'type' => 'select',
                        'label' => [
                            'de-DE' => 'Signalwort',
                            'en-GB' => 'Signal word',
                        ],
                        'componentName' => 'sw-multi-select',
                        'customFieldType' => 'select',
                        'customFieldPosition' => 0,
                        'entity' => 'products',
                        'options' => [
                            [
                                'value' => 'warning',
                                'label' => [
                                    'de-DE' => 'Achtung',
                                    'en-GB' => 'Warning',
                                ]
                            ],
                            [
                                'value' => 'danger',
                                'label' => [
                                    'de-DE' => 'Gefahr',
                                    'en-GB' => 'Danger',
                                ]
                            ],
                        ]
                    ]
                ]]
1 „Gefällt mir“