I’m trying to add sort order filter in my order collection as you can see in this piece of code $collection = $this->orderCollectionFactory->create() ->addAttributeToSelect('*') ->addAttributeToFilter('created_at', array('from' => $from, 'to' => $to)) ->addAttributeToFilter("consignment_status", $orderStatus, "eq") ->addAttributeToFilter("status", $statusToGet, "in") ->setPageSize($this->_consignmentHelper->getGeneralPageSize()) ->setOrder('entity_id', 'DESC') ->addAttributeToSort('entity_id', 'DESC'); echo $collection->getSelect()->__toString(); return $collection; after that when i […]