2Hats . 1 minute

How to use Label property for select box in shopware 6 admin ?

In Shopware 6, we have this cool feature of showing labels with database entity field names in the backend administration. If the entity does not have a name field, the label will not be shown in the interface for plugin configuration and custom fields.

Let’s check with an example

Here we are going to add a salutation entity as a single select in the plugin configuration

The above configuration will not show the salutation labels. It will show the selected box but the option labels are empty.

Fig : Plugin configuration

We can solve this issue by using the “label property” available in shopware 6. You can use the field name inside the “label property”. Here displayName is a field name in the database table.

 

The above configuration will fetch and display the label in the select box.

Fig: Plugin configuration with labels

The following example will show how to use “label property” for custom fields.

 

blog
Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
Aneesh ceo
Aneesh Sreedharan
Founder & CEO, 2Hats Logic Solutions
Subscribe to our Newsletter
Aneesh ceo

    Stay In The Loop!

    Subscribe to our newsletter and learn about the latest digital trends.