Altering Config Data During Setup

Posted Almost 12 years ago. Visible to the public.

Assuming $installer refers to Mage_Core_Model_Resource_Setup or a subclass of it, you can do the following:

Setting a value in the default scope:
$installer->setConfigData('some/path', 'value');

Setting a value in a specific store:
$installer->setConfigData('some/path', 'value', 'stores', 1);

Deleting a value from all scopes:
$installer->deleteConfigData('some/path');

Deleting a value from a certain scope (unfortunately you cannot choose which scope ID though:
$installer->deleteConfigData('some/path', 'stores');

Mike Whitby
Last edit
Over 10 years ago
Posted by Mike Whitby to Magento (2012-05-04 09:37)