Search code examples
configurationconfigmagento-1.9magento-1.8

What is diffrence between getstoreconfig and getstoreconfigflag?


In magento 1.9 What is diffrence between getstoreconfig() and getstoreconfigflag() methods?


Solution

  • The methods look like this:

        public static function getStoreConfig($path, $store = null)
        {
            return self::app()->getStore($store)->getConfig($path);
        }
    
        public static function getStoreConfigFlag($path, $store = null)
        {
            $flag = strtolower(self::getStoreConfig($path, $store));
            if (!empty($flag) && 'false' !== $flag) {
                return true;
            } else {
                return false;
            }
        }
    

    The only difference is that getStoreConfig() will return the exact value while getStoreConfigFlag() returns boolean true or false.

    Both methods send us to Mage_Core_Model_Store::getConfig().