You can do in magento 2 as below way, use \Zend_Db_Expr $collection-> getSelect()->order(new \Zend_Db_Expr('FIELD(e.entity_id, ...
The FilterGroup class acts like a collection of Filters that apply one or more
use this one I have worked on the same way try it. $collection = Mage::getModel(' catalog/product') ->getCollection() ->addAttributeToSort('name', ...
this question is if id 10 exist then move item to first place. Then sort by "is it id 10" first (true > false), then sort by your other expression: $id=10; $collection ...
You could use addAttributeToSort() $collection = Mage::getModel("blogpromo/ blogpromo")->getCollection() ->addFieldToFilter('status', ...
So basically if 2 products have the same position, the one with the lowest ID is displayed first.
This http://blog. chapagain.com.np/magento-join-filter-select-and-sort-
Using Magento ver. 2.2.5 I am using the blank theme. By default my products are being displayed with the sort order of product ID, descending, ...
then change the default sorting direction to descending: open ...
Previous Get Product Collection by Category ID