Magento Forum

   
Default value on system.xml file
 
centerax
Sr. Member
 
Avatar
Total Posts:  90
Joined:  2008-09-10
Montevideo, Uruguay
 

Hi,
I’ve written a module and it has a configuration section under system_config.

I would like to know how can I set up default values for those configuration fields.

Is that possible?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Use your config.xml

<config>
    <default>
       <
sales>
            <
totals_sort>
                <
discount>20</discount>
                <
grand_total>100</grand_total>
                <
shipping>30</shipping>
                <
subtotal>10</subtotal>
                <
tax>40</tax>
            </
totals_sort>
            <
reorder>
                <
allow>1</allow>
            </
reorder>
        </
sales>
    </default>
</
config>

That is a snippet from this file: /magento/app/code/core/Mage/Sales/etc/config.xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
centerax
Sr. Member
 
Avatar
Total Posts:  90
Joined:  2008-09-10
Montevideo, Uruguay
 

thank you Lee, I’ll try this out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chapagain
Sr. Member
 
Avatar
Total Posts:  202
Joined:  2009-07-19
 

These tutorials will surely help:-

Magento: Add default value to System Configuration Option fields

Magento Default System Configuration Values

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top