В magento после программной перестройки плоского каталога товаров с помощью скрипта, который я нашел на http://www.magentocommerce.com/boards/viewthread/43238/, я получаю сообщение об ошибке exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.display_price_group_0' in 'field list''
всякий раз, когда пытаюсь обновить свойства продукта.
Еще большестранно, я проверял другие установки Magento и, кажется, в таблице нет столбца "display_price_group_0" catalog_product_flat_1
...
У кого-нибудь есть подсказка относительно того, что происходит?Как правильно программно перестроить плоский каталог?Большое спасибо!
<?php
// Carico l'enviroment dell'istallazione di Magento per sfruttare i suoi Model
require_once('..'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Mage.php');
Mage::app();
// Inizializzo il file di log
$logFileName = 'clear_cache.log';
Mage::log("Inizio pulizia cache",null,$logFileName);
try {
Mage::getSingleton('catalog/url')->refreshRewrites();
Mage::log("[INFO] Catalog rewrites e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
Mage::getSingleton('catalog/index')->rebuild();
Mage::log("Catalog Index e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
$flag = Mage::getModel('catalogindex/catalog_index_flag')->loadSelf();
if ($flag->getState() == Mage_CatalogIndex_Model_Catalog_Index_Flag::STATE_RUNNING){
$kill = Mage::getModel('catalogindex/catalog_index_kill_flag')->loadSelf();
$kill->setFlagData($flag->getFlagData())->save();
}
$flag->setState(Mage_CatalogIndex_Model_Catalog_Index_Flag::STATE_QUEUED)->save();
Mage::getSingleton('catalogindex/indexer')->plainReindex();
Mage::log("[INFO] Layered Navigation Indices e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
Mage::getModel('catalog/product_image')->clearCache();
Mage::log("[INFO] Image cache e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
Mage::getSingleton('catalogsearch/fulltext')->rebuildIndex();
Mage::log("[INFO] Search Index e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
Mage::getSingleton('cataloginventory/stock_status')->rebuild();
Mage::log("[INFO] CatalogInventory Stock Status e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
Mage::getResourceModel('catalog/category_flat')->rebuild();
Mage::log("[INFO] Flat Catalog Category e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
try {
Mage::getResourceModel('catalog/product_flat_indexer')->rebuild();
Mage::log("[INFO] Flat Catalog Product e' stato aggiornato con successo",null,$logFileName);
} catch (Exception $e) {
Mage::log("[ERRORE] " . $e,null,$logFileName);
}
Mage::log("Fine pulizia cache",null,$logFileName);
?>