In this post I am going to explain how to get list of all orders or you can say order collection in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_orderCollectionFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory, array $data = [] ) { $this->_orderCollectionFactory = $orderCollectionFactory; parent::__construct($context, $data);…


Recent Comments