How to get data from Magento System Configuration

后端 未结 4 1064
清酒与你
清酒与你 2021-01-30 05:19

I just wandering on how I can get the configuration data for my custom module. The configuration can be set from the admin system->configuration and how to pull

4条回答
  •  -上瘾入骨i
    2021-01-30 05:45

    you should you use following code

    $configValue = Mage::getStoreConfig(
                       'sectionName/groupName/fieldName',
                       Mage::app()->getStore()
                   ); 
    

    Mage::app()->getStore() this will add store code in fetch values so that you can get correct configuration values for current store this will avoid incorrect store's values because magento is also use for multiple store/views so must add store code to fetch anything in magento.

    if we have more then one store or multiple views configured then this will insure that we are getting values for current store

提交回复
热议问题