{"id":307298,"date":"2021-09-28T05:47:34","date_gmt":"2021-09-28T05:47:34","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=307298"},"modified":"2024-06-19T13:44:12","modified_gmt":"2024-06-19T13:44:12","slug":"validate-system-xml-fields-data-when-saving-the-configuration","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/","title":{"rendered":"Validate system.xml fields data when saving the configuration"},"content":{"rendered":"\n<p>Hello Friends!<br><br>In this blog, we will learn how we can validate store configuration fields information when saving the configurations.<\/p>\n\n\n\n<p>For example, we have to display the product information on a page and we want to display the product attributes in customized sort orders. So, we will configure these sorts of orders from the store configuration section. And we want to validate the sort order number must not be repeated.<\/p>\n\n\n\n<p>So, to validate this scenario, we can create a plugin to validate the sort order input fields values.<br>To do this, please follow the below steps:<br><br><strong>1. Create system.xml file inside the app\/code\/Vendor\/CustomModule\/etc\/adminhtml\/ directory.<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;..\/..\/..\/Config\/etc\/system_file.xsd&quot;&gt;\n    &lt;system&gt;\n        &lt;tab id=&quot;vendorname&quot; translate=&quot;label&quot; sortOrder=&quot;10&quot;&gt;\n            &lt;label&gt;VendorName&lt;\/label&gt;\n        &lt;\/tab&gt;\n        &lt;section id=&quot;custommodule&quot; translate=&quot;label&quot; sortOrder=&quot;10&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n            &lt;label&gt;Custom Module Configuration&lt;\/label&gt;\n            &lt;tab&gt;vendorname&lt;\/tab&gt;\n            &lt;resource&gt;Vendor_CustomModule::config_blogs&lt;\/resource&gt;\n            &lt;group id=&quot;general&quot; translate=&quot;label&quot; sortOrder=&quot;10&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n                &lt;label&gt;Display Product Attributes Sort Order Settings&lt;\/label&gt;\n                &lt;field id=&quot;name_sort_order&quot; translate=&quot;label&quot; type=&quot;text&quot; sortOrder=&quot;10&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n                    &lt;label&gt;Sort Order for ProductName&lt;\/label&gt;\n                    &lt;validate&gt;required-entry&lt;\/validate&gt;\n                &lt;\/field&gt;\n                &lt;field id=&quot;price_sort_order&quot; translate=&quot;label&quot; type=&quot;text&quot; sortOrder=&quot;10&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n                    &lt;label&gt;Sort Order for Price&lt;\/label&gt;\n                    &lt;validate&gt;required-entry&lt;\/validate&gt;\n                &lt;\/field&gt;\n                &lt;field id=&quot;sku_sort_order&quot; translate=&quot;label&quot; type=&quot;text&quot; sortOrder=&quot;10&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n                    &lt;label&gt;Sort Order for SKU&lt;\/label&gt;\n                    &lt;validate&gt;required-entry&lt;\/validate&gt;\n                &lt;\/field&gt;\n                &lt;field id=&quot;customattribute_sort_order&quot; translate=&quot;label&quot; type=&quot;text&quot; sortOrder=&quot;10&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n                    &lt;label&gt;Sort Order for Custom Attributes&lt;\/label&gt;\n                    &lt;validate&gt;required-entry&lt;\/validate&gt;\n                &lt;\/field&gt;\n            &lt;\/group&gt;\n        &lt;\/section&gt;\n    &lt;\/system&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p><strong>2. Declare the plugin in di.xml file inside the app\/code\/Vendor\/CustomModule\/etc\/adminhtml\/ directory.<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:ObjectManager\/etc\/config.xsd&quot;&gt;\n    &lt;type name=&quot;Magento\\Config\\Model\\Config&quot;&gt;\n        &lt;plugin name=&quot;admin_system_config_save_plugin&quot; type=&quot;Vendor\\CustomModule\\Plugin\\Config\\Model\\ConfigPlugin&quot; sortOrder=&quot;1&quot;\/&gt;\n    &lt;\/type&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p><strong>3. Create ConfigPlugin.php file to define the plugin inside the app\/code\/Vendor\/CustomModule\/Plugin\/Config\/Model\/ directory.<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Vendor Desc.\n *\n * @category  Vendor\n * @package   Vendor_CustomModule\n * @author    Vendor\n * @copyright Copyright (c) Vendor (https:\/\/example.com)\n * @license   https:\/\/example.com\/license.html\n *\/\nnamespace Vendor\\CustomModule\\Plugin\\Config\\Model;\n\nclass ConfigPlugin\n{\n    \/**\n     * @var \\Magento\\Framework\\App\\RequestInterface\n     *\/\n    protected $request;\n\n    \/**\n     * @var array\n     *\/\n    private $sortOrderArray = &#091;];\n   \n    \/**\n     * Construct.\n     *\n     * @param \\Magento\\Framework\\App\\RequestInterface $request\n     *\/\n    public function __construct(\n        \\Magento\\Framework\\App\\RequestInterface $request\n    ) {\n        $this-&gt;request = $request;\n    }\n\n    \/**\n     * added validation for sort order around save action\n     *\n     * @param \\Magento\\Config\\Model\\Config $subject\n     * @param \\Closure $proceed\n     *\n     * @return void\n     *\/\n    public function aroundSave(\n        \\Magento\\Config\\Model\\Config $subject,\n        \\Closure $proceed\n    ) {\n        $requestData   = $this-&gt;request-&gt;getParams();\n        $configSection = $requestData&#091;&quot;section&quot;] ?? &quot;&quot;;\n\n        if ($configSection == &quot;custommodule&quot;) {\n            $groups         = $requestData&#091;&quot;groups&quot;] ?? &#091;];\n            $this-&gt;sortOrderArray = &#091;];\n            if (!empty($groups)) {\n                $nameSortOrder  = $groups&#091;&quot;general&quot;]&#091;&quot;fields&quot;]&#091;&quot;name_sort_order&quot;]&#091;&quot;value&quot;]  ?? &quot;&quot;;\n                $this-&gt;pushSortOrderInArray($nameSortOrder);\n\n                $priceSortOrder = $groups&#091;&quot;general&quot;]&#091;&quot;fields&quot;]&#091;&quot;price_sort_order&quot;]&#091;&quot;value&quot;] ?? &quot;&quot;;\n                $this-&gt;pushSortOrderInArray($priceSortOrder);\n\n                $dateSortOrder  = $groups&#091;&quot;general&quot;]&#091;&quot;fields&quot;]&#091;&quot;sku_sort_order&quot;]&#091;&quot;value&quot;]  ?? &quot;&quot;;\n                $this-&gt;pushSortOrderInArray($dateSortOrder);\n\n                $attrSortOrder = $groups&#091;&quot;general&quot;]&#091;&quot;fields&quot;]&#091;&quot;customattribute_sort_order&quot;]&#091;&quot;value&quot;]  ?? &quot;&quot;;\n                $this-&gt;pushSortOrderInArray($attrSortOrder);\n\n                $prevCount  = count($this-&gt;sortOrderArray);\n                $afterCount = count(array_unique($this-&gt;sortOrderArray));\n                \n                if ($prevCount != $afterCount) {\n                    throw new \\Magento\\Framework\\Exception\\AlreadyExistsException(\n                        __(&#039;Attribute sort order must be unique.&#039;)\n                    );\n                }\n            }\n        }\n        \n        return $proceed();\n    }\n\n    \/**\n     * push sort order in array\n     *\n     * @param int $value\n     *\n     * @return void\n     *\/\n    private function pushSortOrderInArray($value)\n    {\n        if ($value != &quot;&quot;) {\n            $this-&gt;sortOrderArray&#091;] = $value;\n        }\n    }\n}<\/pre>\n\n\n\n<p><strong>4. After executing the <em>setup:di: compile<\/em> command from CLI and flushing the cache, the result will be as in the below images:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"543\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png\" alt=\"config1\" class=\"wp-image-307302\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-300x136.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-250x113.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-768x348.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1536x695.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1.png 1807w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"557\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2-1200x557.png\" alt=\"config2\" class=\"wp-image-307303\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2-1200x557.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2-300x139.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2-250x116.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2-768x357.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2-1536x713.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config2.png 1775w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"513\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3-1200x513.png\" alt=\"config3\" class=\"wp-image-307304\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3-1200x513.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3-300x128.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3-250x107.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3-768x328.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3-1536x657.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config3.png 1801w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Hope this will be helpful. Thanks \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends! In this blog, we will learn how we can validate store configuration fields information when saving the configurations. For example, we have to display the product information on a page and we want to display the product attributes in customized sort orders. So, we will configure these sorts of orders from the store <a href=\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":249,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[12115,1907],"class_list":["post-307298","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-custom-validation-in-system-xml","tag-system-xml"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Validate system.xml fields data when saving the configuration - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Validate system.xml fields data when saving the configuration - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Hello Friends! In this blog, we will learn how we can validate store configuration fields information when saving the configurations. For example, we have to display the product information on a page and we want to display the product attributes in customized sort orders. So, we will configure these sorts of orders from the store [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-28T05:47:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-19T13:44:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png\" \/>\n<meta name=\"author\" content=\"Khushboo Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khushboo Sahu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\"},\"author\":{\"name\":\"Khushboo Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\"},\"headline\":\"Validate system.xml fields data when saving the configuration\",\"datePublished\":\"2021-09-28T05:47:34+00:00\",\"dateModified\":\"2024-06-19T13:44:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\"},\"wordCount\":180,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png\",\"keywords\":[\"custom validation in system.xml\",\"system.xml\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\",\"url\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\",\"name\":\"Validate system.xml fields data when saving the configuration - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png\",\"datePublished\":\"2021-09-28T05:47:34+00:00\",\"dateModified\":\"2024-06-19T13:44:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1.png\",\"width\":1807,\"height\":818,\"caption\":\"config1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Validate system.xml fields data when saving the configuration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\",\"name\":\"Khushboo Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Khushboo Sahu\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Validate system.xml fields data when saving the configuration - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/","og_locale":"en_US","og_type":"article","og_title":"Validate system.xml fields data when saving the configuration - Webkul Blog","og_description":"Hello Friends! In this blog, we will learn how we can validate store configuration fields information when saving the configurations. For example, we have to display the product information on a page and we want to display the product attributes in customized sort orders. So, we will configure these sorts of orders from the store [...]","og_url":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-28T05:47:34+00:00","article_modified_time":"2024-06-19T13:44:12+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png","type":"","width":"","height":""}],"author":"Khushboo Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Khushboo Sahu","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/"},"author":{"name":"Khushboo Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca"},"headline":"Validate system.xml fields data when saving the configuration","datePublished":"2021-09-28T05:47:34+00:00","dateModified":"2024-06-19T13:44:12+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/"},"wordCount":180,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png","keywords":["custom validation in system.xml","system.xml"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/","url":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/","name":"Validate system.xml fields data when saving the configuration - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1-1200x543.png","datePublished":"2021-09-28T05:47:34+00:00","dateModified":"2024-06-19T13:44:12+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/config1.png","width":1807,"height":818,"caption":"config1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/validate-system-xml-fields-data-when-saving-the-configuration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Validate system.xml fields data when saving the configuration"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca","name":"Khushboo Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Khushboo Sahu"},"url":"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/307298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/249"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=307298"}],"version-history":[{"count":4,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/307298\/revisions"}],"predecessor-version":[{"id":448817,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/307298\/revisions\/448817"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=307298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=307298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=307298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}