문제

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 ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top