To get store config data, I would use this code:
$data = Mage::getStoreConfig('my/path/whatever');
Now, how could I save to that node? I tried Alans suggestions from Override Magento Config, but it did not work for me.
Thanks!
To get store config data, I would use this code:
$data = Mage::getStoreConfig('my/path/whatever');
Now, how could I save to that node? I tried Alans suggestions from Override Magento Config, but it did not work for me.
Thanks!
Try following:
$value = "100";
Mage::getModel('core/config')->saveConfig('my/path/whatever', $value);
OR
$resource = $this->getResourceModel();
$resource->saveConfig(rtrim('my/path/whatever', '/'), 1, 'default', 0);
Empire Solution is right but do remember to clean cache after it. So use something like
$value = "100";
Mage::getModel('core/config')->saveConfig('my/path/whatever', $value);
Mage::getModel('core/config')->cleanCache();
I have a cases when i need change configuration and get changed configuration in the same runnig script. So the expresion doese not work for me:
$value = "100";
Mage::getModel('core/config')->saveConfig('my/path/whatever', $value);
Mage::getModel('core/config')->cleanCache();
I looked at the Mage class and realized that $_config property is a static property and found Mage::reset() method. So fo my case work such expression:
$value = "300";
Mage::getModel('core/config')->saveConfig('my/test/config', $value);
Mage::getModel('core/config')->cleanCache();
Mage::reset();
Mage::app();
$changed_data = Mage::getStoreConfig('my/test/config');