I am facing problem at the time of importing of product.
so i want to clear cache before import product.
how can i clear cache before insert product into system and in which file i have to add your code.
Please help me to sort out this things to be done…
$sql = “UPDATE {$prefix}catalog_product_flat_".$store->getStoreId()." SET `".$field."` = ‘“.$price.”’ WHERE `catalog_product_flat_".$store->getStoreId()."`.`entity_id` =”.$product->getEntityId() ;
Mage::getSingleton("core/resource")->getConnection("core_read")->query($sql);
}
}
}
Hope to work for you too!
Regards,
Mihai - Ecommerce Store
PHP Fatal error: Uncaught exception ‘Zend_Db_Statement_Exception’ with message ‘SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘display_price_group_0’ in ‘field list’’ in /lib/Zend/Db/Statement/Pdo.php:259
Stack trace:
#0 /lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array)
#2 /lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query(’UPDATE catalog_...’, Array)
#3 /lib/Varien/Db/Adapter/Pdo/Mysql.php(281): Zend_Db_Adapter_Pdo_Abstract->query(’UPDATE catalog_...’, Array)
#4 /demosflatcatalog.php(63): Varien_Db_Adapter_Pdo_Mysql->query(’UPDAT in /lib/Zend/Db/Statement/Pdo.php on line 259
demosflatcatalog.php is my file with your script…
Dont you think
$field = “display_price_group_”.$group->getCustomerGroupId();
should be $field = e."display_price_group_".$group->getCustomerGroupId();…
I haven’t tried Mihai’s solution because it seems a bit too radical to directly alter the database schema, and also because there are posts saying it does not fix the problem…
Use the file from attachment and put it in root of magento and lunch with http://sitename/refresh.php.
About fields them are in database like : display_price_group_x not like the error e.display_price_group_x.
I alter the table adding the fields that missing, because when flat_product are reindexed from frontend , that fields are deleted and not recreated, with this fix i tryed to complete the reindex process.
Just try, if error not corrected , allways you can find reindex button from backend.
If it helps i started getting this error after deleting the default Store view, because this function looks for default and if it doesn’t find it, it errors.
So i recreated the default store view, important with code: default and it’s now working again.