I have created a custom script to display products on home page filter by product ids.
$_productCollection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('entity_id', array('in' => $product_ids)) ->addAttributeToFilter('status', array('eq' => 1)) ->addAttributeToFilter('visibility', 4);
But products showing on frontend in entity_id (ASC) orders. To order by product_ids array I found below code and it is working :
$_productCollection->getSelect()->order(new Zend_Db_Expr('FIELD(entity_id, ' . $product_ids.')'))
php shell/indexer.php -reindex catalog_product_flat index is in processing this line shows error on frontend
there has been error processing your request.
This error still coming If catalog flat tables setting are disabled in admin panel and no index is in processing state.
Why this is happening?