diff --git a/src/Model/Resolver/ProductResolver.php b/src/Model/Resolver/ProductResolver.php index d39d3c6..dea036f 100755 --- a/src/Model/Resolver/ProductResolver.php +++ b/src/Model/Resolver/ProductResolver.php @@ -86,6 +86,9 @@ public function resolve( } $productIds = array_map(function ($item) { + foreach ($item->getChildrenItems() as $item){ + return $item->getProduct()->getId(); + } return $item['product_id']; }, $value['products']); @@ -117,7 +120,8 @@ public function resolve( foreach ($value['products'] as $key => $item) { /** @var $item Item */ - $data[$key] = $productsData[$item->getProductId()]; + $productId = $item->getChildrenItems() ? $item->getChildrenItems()[0]->getProduct()->getId() : $item->getProductId(); + $data[$key] = $productsData[$productId]; $data[$key]['qty'] = $item->getQtyOrdered(); $data[$key]['row_total'] = $item->getBaseRowTotalInclTax(); $data[$key]['original_price'] = $item->getBaseOriginalPrice();