Magento using core_config_data table

Core_config_data is a magento table used to save configuration and setting. It’s really helpfull and easy to use :

save or update a new entry :

$data = new Mage_Core_Model_Config();
$data->saveConfig('adin/ssid', 'value', 'default', 0);

and retrieve saved value :

$value = Mage::getConfig()->getNode('default/adin/ssid');

You may need to specify scope and scope code to retrieve the value

$value = Mage::getConfig()->getNode('default/sogen/file_number', 'default', 0 );

Update or create a value inside the installer (data, no sql)

  $installer->setConfigData('customer/address/prefix_show', 0);

In a setup file

 $installer->setConfigData('your/path', 'value', 'stores', 1);
 $installer->deleteConfigData('your/path', 'stores');

Leave a Reply