0

How can I add a field in admin panel > system > configuration > Sales ?

7

You can add the new group in sales with following code.

Add it to your modules system.xml file.

<config>
    <sections>
         <sales>
            <groups>
                <newgroup translate="label" module="sales">
                    <label>New</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>250</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <new_field translate="label">
                            <label>New</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </new_field>
                    </fields>
                </newgroup>
            </groups>
        </sales>
    </sections>
</config> 

New Group

You can add a field in already existing group

<config>
    <sections>
         <sales>
            <groups>
                <general>
                    <fields>
                        <new_field_ex_group translate="label">
                            <label>New Ex Group</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </new_field_ex_group>
                    </fields>
                </general>
            </groups>
        </sales>
    </sections>
</config>

ex-group

Refer Link

Edit :

To add new tab in sales section

<config>
    <sections>
        <yoursection translate="label">
            <label>Your section under sales</label>
            <tab>sales</tab> <!-- you can change to any deafult tabs -->
            <frontend_type>text</frontend_type>
            <sort_order>500</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
        </yoursection>
    </sections>
</config>
  • Thanks for your question. But i mean not in sales but under the sales section on the left in admin panel > system > configuration . Sorry for misunderstanding. – user3819713 Aug 10 '15 at 7:44
  • @user3819713 Check my update – MeenakshiSundaram R Aug 10 '15 at 7:54
  • works perfect :) – jruzafa Feb 29 '16 at 12:19
  • In your first code of adding new fields, </sections> node having typo error please correct so that others can use this. – Ashish Madankar M2 Professiona May 23 '16 at 6:47

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.