{"id":942,"date":"2020-04-14T08:44:47","date_gmt":"2020-04-14T08:44:47","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/04\/14\/create-system-xml-configuration-in-magento-2\/"},"modified":"2025-05-22T13:32:37","modified_gmt":"2025-05-22T08:02:37","slug":"create-system-xml-configuration-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/create-system-xml-configuration-in-magento-2\/","title":{"rendered":"How to Create System.xml Configuration In Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2 is a feature-rich platform with default functionalities suitable for E-commerce businesses. However, with the evolving nature of shopping online and types of businesses, the default Magento 2 falls short. Fortunately, due to the customization capability of the platform, the store owners can use&nbsp;<a href=\"https:\/\/meetanshi.com\/magento-2-extensions.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 extensions<\/a>&nbsp;to implement additional functionalities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, there are many extensions where the store owner or admin has to configure a few settings and for which one needs to&nbsp;<em><strong>create system.xml configuration in Magento 2<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Allow the admin to flexibly configure the module by offering fields at Admin Panel &gt; Stores &gt; Configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/04\/System.xml_.png\" alt=\"System.xml\" class=\"wp-image-8702\" style=\"object-fit:cover\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Create system.xml configuration file in Magento 2 with the below code:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to create system.xml configuration in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create&nbsp;<em><strong>system.xml<\/strong><\/em>&nbsp;file at&nbsp;<strong>appcodeVendorExtensionetcadminhtml<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?xml version=\"1.0\"?>\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n        xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Config:etc\/system_file.xsd\">\n    &lt;system>\n        &lt;tab id=\"vendor\" translate=\"label\" class=\"vendor\" sortOrder=\"100\">\n            &lt;label>vendor&lt;\/label>\n        &lt;\/tab>\n        &lt;section id=\"extension\" translate=\"label\" type=\"text\" sortOrder=\"40\" showInDefault=\"1\" showInWebsite=\"1\"\n                 showInStore=\"1\">\n            &lt;class>separator-top&lt;\/class>\n            &lt;label>Extension&lt;\/label>\n            &lt;tab>vendor&lt;\/tab>\n            &lt;resource>Vendor_Extension::config_extension&lt;\/resource>\n            &lt;group id=\"general\" translate=\"label\" type=\"text\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\"\n                   showInStore=\"1\">\n                &lt;label>Configuration&lt;\/label>\n                &lt;field id=\"enable\" translate=\"label comment\" type=\"select\" sortOrder=\"10\" showInDefault=\"1\"\n                       showInWebsite=\"1\" showInStore=\"1\">\n                    &lt;label>Extension Enable&lt;\/label>\n                    &lt;source_model>Magento\\Config\\Model\\Config\\Source\\Enabledisable&lt;\/source_model>\n                &lt;\/field>\n            &lt;\/group>\n        &lt;\/section>    \n    &lt;\/system>\n&lt;\/config><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please share the solution with fellow Magento developers via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 is a feature-rich platform with default functionalities suitable for E-commerce businesses. However, with the evolving nature of shopping online and types of businesses,&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-942","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=942"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions"}],"predecessor-version":[{"id":14969,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions\/14969"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}