I tried to get the size of a product/products that was ordered.
So let's say a product has 5 sizes: S, M, L, XL,XLL and when i made the order the product x was bought with the size M
.
When i load the order i want to get this "M" size in my code.
This is how i load my order:
$order = $_objectManager->create('Magento\Sales\Model\Order')->load($orderID);
foreach ($order->getAllItems() as $item) {
$product = $_objectManager->create('Magento\Catalog\Model\Product')->load($item->getProductId());
... here i want to get the size
}
Does anyone know how to do that? because i didn't find nothing relevant.
Thank you!