Shopware 6 Add additional fields

Add individual Sshopware 6 free text fields to products

How to add Shopware 6 additional fields to assign individual properties to your products or categories, we will show you in this Shopware 6 tutorial. Integrate the free text fields known from Shopware 5 now also in Shopware 6, that is the content of this tutorial.

Shopware 6 Add additional fields - how to do it

This Shopware 6 blog article is about additional fields.
The additional fields replace the free text fields known from Shopware 5 and offer you the possibility to add your own fields for the different program areas, in order to use them e.g. in the products.
We will now explain to you how this works in the following.

Here you can find the Shopware 6 additional fields

You go to the settings in your Shopware 6 backend, but this time to the sub-item “System“. There you click on the additional fields and can create your first set by clicking on the blue button.
The technical name may only be used once in the system and cannot be changed subsequently. We call this one “custom_color_1” in our case.
Since it is our first set we position it on the 1 as well. The label is a recognition name for the user. We call this“Color“.
Additional fields can be used not only for products, but also for categories, manufacturers, customers, etc. However, in our case we want to apply the additional field set to our products.
After you have saved the set, you can create a new additional field within this set.

Create new additional field

As type you could choose the color selection to display the hexacode. For us, however, a text field is sufficient for this video, in which the respective color can then be entered as a word. The label is used to assign a name that is comprehensible to the user. This designation is displayed e.g. in the modules of the administration, if the additional field is included there.
The placeholder is displayed as long as no input has been made.
The help text can be displayed via mouseover over a blue question mark symbol. Before you click Add, copy the code “custom_color_1_”. We’re going to need that in a minute. Now click on Add, with which we have created our first text field for the color.

Embed free text field in product

The next step is to integrate this text field as an additional field in any product. That is why we go to catalogs and products and our blue chain. Now scroll down to the additional fields and enter the desired color.
So blue for us. Then save.
Now you need to make a small change to your template. To be exact in the “description.html.twig” file. You can find them in the following directory:

/custom/plugins/yourTheme/src/Resources/views/storefront/page/product-details/

Changing the template

You can do this for example. with an FTP client like FileZilla.
Open this file with a text editor like Sublime.
You can already see here in the Shopware 6 screencast that we have already inserted the necessary code lines. Accordingly, we can adjust the necessary places for our additional field or copy the existing code and paste it below. “Color” is what we want to play out as “color” in the frontend.
Now the code we just listed becomes relevant. Insert it at this exact position and save the changes.

Shopware 6 add additional fields and examine in the frontend

To make sure that the additional field is really displayed in the store frontend, we clear the caches under Settings, System and Caches and go to the frontend. Here you can now examine your just generated feed fields in the respective product.

For questions about Shopware 6 contact eBakery

If there are any questions about it, leave them for us in the comments. For all other Shopware 6 optimization requests, contact our Shopware 6 experts. You can find all the information on our Shopware Agency page.

  • 0/5
  • 0 ratings
0 ratingsX
Very bad! Bad Hmmm Oke Good!
0% 0% 0% 0% 0%

Haben Sie Fragen oder brauchen ein individuelles Angebot? Zögern Sie nicht, uns zu kontaktieren.


    eBakery requires the contact information you provide to contact you regarding our products and services. You can unsubscribe from these notifications at any time. For information on unsubscribing, as well as our privacy practices and commitment to protecting your privacy, please see our Privacy Policy.*.

    Related Posts

    Leave a Comment

    Hat dir der Artikel gefallen?

    Dann melde dich doch zu unserem Newsletter an!

    Neben unseren Blog Themen informieren wir dich darin regelmäßig zu neuen Features und Tutorials