Home » Magento1 May 2011

Magento: Add default value to System Configuration Option fields

This article shows how to add default value to any system configuration option fields. System configuration option fields means those options under System -> Configuration.

Suppose, you have the following system.xml file. System.xml file is necessary to add admin configuration options.


Now, to add default value to the admin configuration options, you need to write the following in config.xml file of your module. The should be inside config node.


Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Access3000


    thanks for sharing your knwoledge. Do you also know how to set up default values for options (select fields) in an adminhtml form. Is it possible?

  • Access3000


    i have answered my own question.

    You can do it like this in your Form.php:
            $myObject = new Varien_Object();
            // set object data to data of model, stored in registry

            // place this code right before you add your field with addField()
            // set default value for field product_status
            if ( ! $myObject->hasProductStatus()) {  $myObject->setProductStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

  • Khamar_pratik


    This is my code and add in custom module to enable disable module in system.xml but didn’work pls help ….