4
要獲取存儲配置數據,我會使用此代碼:如何以編程方式設置Magento商店配置數據?
$data = Mage::getStoreConfig('my/path/whatever');
現在,我怎麼能保存到該節點?我從Override Magento Config嘗試了阿蘭斯的建議,但它對我不起作用。
謝謝!
要獲取存儲配置數據,我會使用此代碼:如何以編程方式設置Magento商店配置數據?
$data = Mage::getStoreConfig('my/path/whatever');
現在,我怎麼能保存到該節點?我從Override Magento Config嘗試了阿蘭斯的建議,但它對我不起作用。
謝謝!
嘗試以下操作:
$value = "100";
Mage::getModel('core/config')->saveConfig('my/path/whatever', $value);
OR
$resource = $this->getResourceModel();
$resource->saveConfig(rtrim('my/path/whatever', '/'), 1, 'default', 0);
帝國解決方案是正確的,但千萬記得之後清理緩存。所以使用類似
$value = "100";
Mage::getModel('core/config')->saveConfig('my/path/whatever', $value);
Mage::getModel('core/config')->cleanCache();
是的,就是這樣,謝謝! – user4095519 2015-01-21 09:27:46
這是否適用於任何配置設置?我在magento.exchange中有類似的問題:http://magento.stackexchange.com/questions/105634/how-to-export-import-features-settings-in-magento – Jurik 2016-03-14 15:28:16