Question

I am going to set the core_config_data table value for flat catalog products via code but when I print in log it always shows wrong values.

Mage::getConfig()->saveConfig('catalog/frontend/flat_catalog_product', '0', 'default', 0);
Mage::log("Flat Catalog Disbale After ... ".Mage::getStoreConfig('catalog/frontend/flat_catalog_product',0),null,'apply.log',true);
Mage::getConfig()->saveConfig('catalog/frontend/flat_catalog_product', '1', 'default', 0);
Mage::log("Flat Catalog Enable After ... ".Mage::getStoreConfig('catalog/frontend/flat_catalog_product',0),null,'apply.log',true); 

Kindly suggest, I need to disable then enable for some code segment but it returns wrong values.

Was it helpful?

Solution

Please try with below code :

Mage::getModel('core/config')->saveConfig('catalog/frontend/flat_catalog_product', '0', 'default', 0);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top