2

例如配置:

default:      some/xml/path: value_1
storeview_5:  some/xml/path: other_value

现在获取:

// store 5
Mage::getStoreConfig('some/xml/path'); // >> other_value
// store 1
Mage::getStoreConfig('some/xml/path'); // >> value 1 (inherited from default)

我想知道 storeview_1 没有自己的配置。

最好的方法是获取配置树,例如:

default     => value_1
website_1   => website_value
storeview_1 => storeview_1_value
storeview_5 => other_value 
// omits empty configs for others or null them, etc.
4

1 回答 1

1

该方法getStoreConfig还接受可选的商店 ID,因此只需将商店 ID 作为第二个参数传递 Mage::getStoreConfig('some/xml/path', $store_id);

于 2012-11-30T14:41:18.563 回答