Get all products sorted by product name ascending:- $collection = Mage:: getModel('catalog/product') ->getCollection() ...
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:
vote 15 Down vote. You can add sort order like this:
be you can add second collection or will post query once i get a time.
To get all order collection with filters, go to the following path Mageplaza/ HelloWorld/Block/Orders.php and create an Orders.php file.
Fetch collection in ascending order with customer id filter, you can ...
Step4: Sorting the collection by "update_time" in Descending order. Step5: Set limit ...
Magento Product collections is a great way of extracting and
In day to day development of Magento, every Developer requires