我正在通过mysql更新产品信息,如数量,发货天数,出货值等,并且值得到更新,但除非重建索引完成,否则在前端即时进行反射不会在frontend.What中反映,或者我可以直接更新重建索引表,这样做是不是一个好的做法?另外,如果产品脱销,这种反射是如何瞬间发生的??
发布于 2013-09-13 12:53:50
在加载前端时尝试此代码,以重新索引所有内容。您可以在Mage文件中检查getSingleton和all的run方法。
require_once 'app/Mage.php';
$app = Mage::app('default');
$indexingProcesses = Mage::getSingleton('index/indexer')->getProcessesCollection();
foreach ($indexingProcesses as $process) {
$process->reindexEverything();
}希望这能有所帮助。
https://stackoverflow.com/questions/18777688
复制相似问题