3

I want to fetch the processing orders, How to fetch the processing orders collection in Magento2.

Thanks Bestregards

1 Answer 1

2

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;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.