1

I have created a module in Magento 2 and want to show it config file in Customers Tab in Stores -> Configuration section.

What I have to give in system.xml file to show in that default section.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="trade_customer" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0">
            <label>Trade Customer</label>
            <tab>customer</tab>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>General Configuration</label>
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Module Enable</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
        </section>
    </system>
</config>
  • Can you add your system.xml to your question? – Sukumar Gorai Aug 31 '18 at 10:22
  • Your question is not clear. What you exactly need, new section tab, new group under existing section tab or only need to add few fields under any existing group? Please specify – Hiren Bhalodiya Aug 31 '18 at 10:29
  • @SukumarGorai I have added – Amrit Pal Singh Aug 31 '18 at 10:48
  • @HirenBhalodiya I have to add my module system config under Customers Tab in Stores -> Configuration – Amrit Pal Singh Aug 31 '18 at 10:49
1

Try the below code:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="trade_customer" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Trade Customer</label>
            <tab>customer</tab>
            <resource>Magento_Customer::config_customer</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>General Configuration</label>
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Module Enable</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
        </section>
    </system>
</config>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.