How to get config variable or data value in magento.?

Magento get default config value

Use the below code to get the default system Magento admin config variable values –

$configValue = Mage::getStoreConfig('section_name/group_name/field_name');

Magento get config value by store

If you want to fetch config value of currently viewed store then you can specify store ID as the second parameter to the getStoreConfig function as below.

$configValue = Mage::getStoreConfig('section_name/group_name/field_name',Mage::app()->getStore());

Note : sectionname, groupname and fieldname are names defined in your config.xml already

You may also like...

Leave a Reply

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