How to create an additional field in the Payment section of the Magento backend?

Added a new payment method by creating a new custom module in the app/code folder and named as Payment.

Created files as follows etc->adminhtml and inside that system.xml

Code:

<?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="payment">
                <group id="termspayment" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Net Account</label>
                    <field id="active" translate="label comment" sortOrder="1" type="select" showInDefault="1" showInWebsite="1" showInStore="0">
                        <label>Enable</label>
                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    </field>
                </group>
        </section>
    </system>
</config>

After this we need to delete the folder in setup module in our database, And after that;

  • php bin/magento setup:upgrade
  • php bin/magento setup:di:compile
  • php bin/magento s:s:d -f en_US –theme Swissup/argento-marketplace
  • sudo chmod 777 -R /var/www/html/Szco_Supplies_Magento_Nestuite_website/

After this, it will be as shown in the screenshot below.
Screenshot:

Leave a comment

Your email address will not be published. Required fields are marked *