You can try this $giftColletion = $this->_giftFactory->getCollection(); $giftColletion ->addFieldToFilter('store_id', 1); $giftColletion->setOrder('position','ASC');.
Try to use Zend_DB_Select order rather then Magento setOrder method $ colection->getSelect()->order(..) Example:
Magento 2 Get All Order Collection with Filters. In today article I would like to show you how to get all order collection with filters by customer, date, status, and ...
But how can i return the collection with this order by query.if i add lik ethis $ career_collection->Order('career_id ASC'); its not working – Mujahidh May 10 '18 at ...
The FilterGroup class acts like a collection of Filters that apply one or more criteria to a search.
default sorting, go to Catalog > Categories, choose the needed category, and open the Display Setting tab.
product 2: price 13$;
We take the example of product collection and filter it by give ids. You can use this on any kind of collection like order collection, category collection and any ...
magento 2 collection order by asc and desc example - It is very simple to set order by clause in Magento 2. We can use setOrder ASC or DESC ...
I show you how to set order of collection for Magento 1 and why there are more than one possibilities. You have to find out if your sort attribute ...