Magento 2 get order collection to update customers id using csv.
For example we can take magento 1 we can update using test.php
file like that how we can update in magento 2.
I am creating new module I am planing to update using controller.But in that how can i get orders collection can any one help me….
Best Answer
I have no idea what you want to tell us here, but I can answer the question:
Collections are now a mere implementation detail, you work with them using
SearchCriteria
andRepository
objects.First, inject the
OrderRepository
and theSearchCriteriaBuilder
into your controller, by adding it to the constructor parameters:Then you can use it like this: