I want to get the products ordered within a date range for a report.
As the result, I need like, product, product type, product Qty.
I tried to load all orders and get the sum of products, it want working out.
$orders = $this->orderCollectionFactory->create()
->addAttributeToFilter('created_at', array('from'=>$dateFrom, 'to'=>$dateTo))
->addFieldToFilter('status', array('nin' => array('canceled','refund_request','refunded', 'return_exchange_request')));
How can I get the products count individually for each product from this collection?
Expecting result |Product-+-type---+-Qty-| +--------+--------+-----+ | P1 | simple | 10 |