$attributes = Mage::getSingleton(‘catalog/config‘)->getProductAttributes(); $collection = Mage::getModel(‘catalog/product‘) ->getCollection() ->addAttributeToFilter(‘entity_id‘, array(‘in‘ => $productIds)) ->addAttributeToSelect($attributes); $collection->getSelect()->order(new Zend_Db_Expr(‘FIELD(e.entity_id, ‘ . implode(‘,‘, $productIds).‘)‘));
时间: 2024-10-24 15:17:27