11
tôi chọn sản phẩm vớiMagento với id cụ thể
$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('entity_id', array('in' => $productIds));
làm thế nào tôi có thể archieve rằng bộ sưu tập là theo thứ tự giống như id trong $ productIds?
nhờ
đẹp giải pháp của tôi là tồi tệ hơn: $ collection-> getSel ect() -> order ("(CASE e.entity_id WHEN $ p1path [1] THÌ 1 KHI $ p2path [1] THÌ 2 KHI $ p3path [1] THEN 3 ELSE 0 END)"); – wutzebaer
@Renon Stewart: bạn đã cứu tôi những ngày trong đời. Cảm ơn: D –