In this post we will see an easy but useful example on how we can get orders that were made by a specific shipping method. Let's have a look together.
In our example we will use the order repository to get a list of all orders by a specific shipping method. We will get all orders that were made by the Magento shipping method flatrate. The shipping method information is saved on the shipping_method field of the sales_order table. In our example block class below you can see how we build our search criteria filtering by shipping_method and how we pass them to the order repository getList function.
Feel free to share this post and ask your questions in the comments below.
Till next time!