Magento: change Config setting without saving it.

In my Magento module, I only want to change the config parameter for one run - the change should not be persisted in the database.

This only needs to be changed under certain conditions at runtime so that all subsequent calls to the kernel, etc. Used this parameter.

I know you can use something like Mage::getConfig()->saveConfig(...)

, but this actually saves the changes to the database.
I am using Magento 1.5

.

Is it possible?

+3


source to share


2 answers


Try the following:

Mage::getConfig()->setNode($path, $value);

      



See http://inchoo.net/ecommerce/magento/how-to-programmatically-change-magentos-core-config-data/comment-page-1/#comment-9535

+3


source


Use $store->setConfig('config_path', 'value_to_set')

for memory cache accounting. Note that this is independent of Magento's config cache, but if you call twice Mage::getStoreConfig()

with the same path, it will not read the loaded XML structure, but instead look for it in the array.



See: fooobar.com/questions/1130227 / ...

0


source







All Articles