wp_lancer
wp_lancer

Reputation: 80

Can I use custom component like sw-entity-multi-select in theme configuration in Shopware 6?

I wanted to store the products in the theme configurations. So, I want to add the sw-entity-multi-select component.

Is there any possibility to use the sw-entity-multi-select component in the theme configuration?

Upvotes: 2

Views: 846

Answers (1)

dneustadt
dneustadt

Reputation: 13161

It's not exactly documented but you can get a multi entity id select to show up in your theme config like this:

{
    // ...
    "config": {
        "fields": {
            "my-multi-select": {
                "type": "multi-entity-id-select",
                "editable": true,
                "custom": {
                    "entity": "product"
                }
            }
        }
    }
}

Note: This is only possible starting with version 6.4.14.0 since the type multi-enitity-id-select was only added then to be mapped to sw-entity-multi-id-select. Also keep in mind that the resulting value will be an array of ids rather than actual entity data, if you were expecting that instead.

Upvotes: 3

Related Questions