Last Updated on January 21, 2022
Create Field from admin in Shopware 6
The additional fields allow you to add your own fields for the various program areas in order to save your own information here. For example, you can enter your own additional information for products or categories that are not yet available in the standard system, which you can then use in the rulebuilder or display in the storefront.
What are Custom Fields?
Custom Fields are those which are used to add your own fields on different program-areas to add some additional information. For example you can add the custom fields to show any additional information for products or categories which is not yet available in standard system.
You can create custom fields using the navigation: Settings -> System -> Custom fields
To add a new Custom Field Click on Add new set
After that you can create the set and then you need to assign the set to any of the program-areas
Click Save and then create New Custom Field.
Then you need to add value to the fields, go to list of products
select product -> edit -> Specifications -> customFields section -> Insert Data -> Click Save
Add custom field in the Frontend in Shopware 6
Adding custom fields in the storefront is quite simple. You basically use Twig this way:
{{ "customFields.custom_description_Name"|trans|sw_sanitize }}: {{ page.product.translated.customFields.custom_description_Name }} You can use the custom field on product detail page like that: <plugin root>/src/Resources/views/storefront/page/product-detail/description.html.twig {% sw_extends '@Storefront/storefront/page/product-detail/description.html.twig' %} {% block page_product_detail_description_content_text %} {{ parent() }} {# Insert your custom field here, as seen below: #} {{ "customFields.custom_description_Name"|trans|sw_sanitize }}: {{ page.product.translated.customFields.custom_description_Name }} {% endblock %}