I want to get all the ordered items by order id. But if configurable product then I want to get only parent item id not it's child product.
For this I am using following code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $orderId = $this->getOrderId(); $order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderId); $orderItems = $order->getAllItems();`
So, How can I skip child products of configurable products?