Skip to main content
2 of 2
added 909 characters in body
Sabareesh
  • 358
  • 6
  • 31

How to get all orders in order history page magento 2.3

I need to get all orders on the sales order history page without any limit I need to get the orders. In Magento 2.3.

I had tried the below code using the OrderCollectionFactory but I am getting the error

if (!$this->orders) {

            $this->orders = $this->orderCollectionFactory->create($customerIds)->addFieldToSelect(
                '*'
            )->addFieldToFilter(
                'status',
                ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
            );
            $this->orders->getSelect()
            ->joinLeft(
                ["sop" => "amt_sales_order_payment"],
                'main_table.entity_id = sop.parent_id',
                ['po_number']
            )
            ->where('sop.po_number LIKE ?',$po_number);
            
            $this->orders->setOrder(
            'ext_order_id',
            'desc'
            );
            
        }

Uncaught Error: Call to a member function create() on null in /var/www/html/app/code/Sm/SalesOrderGridTable/Block/Order/History.php:139 Stack trace: #0

Sabareesh
  • 358
  • 6
  • 31