{"id":12374,"date":"2021-09-10T02:23:46","date_gmt":"2021-09-10T07:53:46","guid":{"rendered":"https:\/\/www.emizentech.com\/blog\/?p=12374"},"modified":"2023-01-30T11:02:00","modified_gmt":"2023-01-30T11:02:00","slug":"how-to-create-and-use-custom-fields-in-shopware-6","status":"publish","type":"post","link":"https:\/\/multisitelocal.ezxdemo.com\/blog\/how-to-create-and-use-custom-fields-in-shopware-6.html","title":{"rendered":"How To Create and Use Custom Fields In Shopware 6"},"content":{"rendered":"<p>Create Field from admin in Shopware 6<\/p>\n<p>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.<\/p>\n<h2>What are Custom Fields?<\/h2>\n<p>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.<\/p>\n<p>You can create custom fields using the navigation: Settings -&gt; System -&gt; Custom fields<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-12214\" src=\"\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/shopware-custom-field-1.png\" alt=\"shopware custom field 1\" width=\"939\" height=\"397\"><\/p>\n<p>To add a new Custom Field Click on Add new set<img decoding=\"async\" class=\"aligncenter size-full wp-image-12215\" src=\"\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/shopware-custom-field-2.png\" alt=\"shopware custom field 2\" width=\"940\" height=\"233\"><\/p>\n<p>After that you can create the set and then you need to assign the set to any of the program-areas<img decoding=\"async\" class=\"aligncenter size-full wp-image-12213\" src=\"\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/shopware-3.png\" alt=\"shopware 3\" width=\"1675\" height=\"814\"><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12217\" src=\"\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/Shopware-4.png\" alt=\"Shopware 4\" width=\"900\" height=\"391\"><\/p>\n<p>Click Save and then create New Custom Field.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12216\" src=\"\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/shopware-5.png\" alt=\"shopware 5\" width=\"527\" height=\"739\"><\/p>\n<p>Then you need to add value to the fields, go to list of products<\/p>\n<p>select product -&gt; edit -&gt; Specifications -&gt; customFields section -&gt; Insert Data -&gt; Click Save<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12218\" src=\"\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/Shopware-6.png\" alt=\"Shopware 6\" width=\"1312\" height=\"754\"><\/p>\n<h2>Add custom field in the Frontend in Shopware 6<\/h2>\n<p>Adding custom fields in the storefront is quite simple. You basically use Twig this way:<\/p>\n<pre>{{ \"customFields.custom_description_Name\"|trans|sw_sanitize }}: {{ page.product.translated.customFields.custom_description_Name }}\n\nYou can use the custom field on product detail page like that:\n\n&lt;plugin root&gt;\/src\/Resources\/views\/storefront\/page\/product-detail\/description.html.twig\n{% sw_extends '@Storefront\/storefront\/page\/product-detail\/description.html.twig' %}\n\u200b\n{% block page_product_detail_description_content_text %}\n    {{ parent() }}\n    {# Insert your custom field here, as seen below: #}\n    {{ \"customFields.custom_description_Name\"|trans|sw_sanitize }}: {{ page.product.translated.customFields.custom_description_Name }}\n{% endblock %}\n<\/pre>\n\n","protected":false},"excerpt":{"rendered":"<p>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<\/p>\n","protected":false},"author":36,"featured_media":12400,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"MSN_Categories":"Uncategorized","MSN_Publish_Option":false,"MSN_Is_Local_News":false,"MSN_Is_AIAC_Included":"Empty","MSN_Location":"[]","MSN_Add_Feature_Img_On_Top_Of_Post":false,"MSN_Has_Custom_Author":false,"MSN_Custom_Author":"","MSN_Has_Custom_Canonical_Url":false,"MSN_Custom_Canonical_Url":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[85],"tags":[84],"class_list":{"0":"post-12374","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-shopware","8":"tag-shopware"},"modified_by":"Marketing EmizenTech","featured_image_src":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/How-to-Create-and-Add-Custom-Fields-in-Shopware-6-1.jpg","featured_image_src_square":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2021\/09\/How-to-Create-and-Add-Custom-Fields-in-Shopware-6-1.jpg","author_info":{"display_name":"Vivek Khatri","author_link":"https:\/\/multisitelocal.ezxdemo.com\/blog\/author\/vivek"},"_links":{"self":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/posts\/12374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/comments?post=12374"}],"version-history":[{"count":0,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/posts\/12374\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/media\/12400"}],"wp:attachment":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/media?parent=12374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/categories?post=12374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/tags?post=12374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}