I want to fetch the processing orders, How to fetch the processing orders collection in Magento2.
Thanks Bestregards
You can use this code:
Class : Magento\Sales\Block\Order\History
/**
* @return bool|\Magento\Sales\Model\ResourceModel\Order\Collection
*/
public function getOrders()
{
if (!($customerId = $this->_customerSession->getCustomerId())) {
return false;
}
if (!$this->orders) {
$this->orders = $this->getOrderCollectionFactory()->create($customerId)->addFieldToSelect(
'*'
)->addFieldToFilter(
'status',
['eq' => 'Processing']
);
}
return $this->orders;
}