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.

有帮助吗?

解决方案

Please try with below code :

Mage::getModel('core/config')->saveConfig('catalog/frontend/flat_catalog_product', '0', 'default', 0);
许可以下: CC-BY-SA归因
scroll top