Magento getStoreConfig多线程

LEG*_*EGO 0 magento magento-1.7

我试图获取我在admin中创建的配置,这是core_config_data表

|config_id|scope   |scope_id|path                            |value|
|123      |websites|2       |myappgeneral/current_time/second|3600 |
|124      |websites|3       |myappgeneral/current_time/second|7200 |
|125      |websites|4       |myappgeneral/current_time/second|1800 |
Run Code Online (Sandbox Code Playgroud)

我有1页显示这样的所有信息

网站2将在3600秒内启动

网站3将在7200秒内启动

网站4将在1800秒内启动

我怎样才能获得价值?THKS

Ser*_*nyy 9

你可以用

Mage::app()->getWebsite($website_id)
    ->getConfig('myappgeneral/current_time/second') 
Run Code Online (Sandbox Code Playgroud)

$ website_id参数是可选的,默认使用当前网站.

但通常您需要一个storeview值,您可以使用它来检索

Mage::getStoreConfig('myappgeneral/current_time/second', $store_id)
Run Code Online (Sandbox Code Playgroud)

$ store_id参数是可选的,可以包含商店视图ID或商店视图代码,默认情况下使用当前商店视图.

更多信息 - http://alanstorm.com/custom_magento_system_configuration,"检索值"部分