When I try to add a field to filter on my magento 2.2.4 quote collection, the quote are not arranged in the right order.
$customerId = $this->_customerSession->getCustomer()->getId();
echo $customerId; // 2
$collection = $this->collection->create();
$collection->addFieldToFilter('customer_id', customerId);
This code reverses my last two ids (121 is after 120).
But this :
$customerId = $this->_customerSession->getCustomer()->getId();
echo $customerId;
$collection = $this->collection->create();
echo "<pre>".print_r($collection->getData(), true)."</pre>";
Is giving me the right order. But i need to filter $collection
by customer_id
. How do I do that ?