Set value in core config table Magento 1.9 issue
-
13-04-2021 - |
سؤال
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);
لا تنتمي إلى magento.stackexchange