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:
Method 4: Get Order Collection Filter by Status. The fourth method to get order collect filter is by status. public function getOrderCollectionByStatus($statuses = []) { ...
2 Answers · 2. the setOrder() results in desc order. Is there any way to make it asc ? – Mohammad Faisal Mar 18 '14 at 9:41 · 2. ->setOrder(' ...
product 2: price 13$;
I have given products sorting number to products in admin area. Now I want to sort products in frontend by descending order. magento2, product collection ...
I am try to sort my product collection. At first it should be sorted by Ascending Order (1,2,3..) and then by other character like NULL
Today we discuss how in Magento 2 sort collection by give ids. Sometime we need to get product collection by given ids form example random ids 5,4,13.
Step3: Sorting the collection by "news_id" in Ascending order.
Learn how to get order collection in Magento 2 by using dependency injection instead of Object Manager from our guide. Read on.