diff --git a/DataLayer/Mapper/ProductDataMapper.php b/DataLayer/Mapper/ProductDataMapper.php index e727f77..a710472 100644 --- a/DataLayer/Mapper/ProductDataMapper.php +++ b/DataLayer/Mapper/ProductDataMapper.php @@ -82,7 +82,11 @@ public function mapByProduct(ProductInterface $product): array } catch (NoSuchEntityException $noSuchEntityException) { } - $productData['price'] = $this->priceFormatter->format((float)$product->getFinalPrice()); + $productData['price'] = $this->priceFormatter->format((float) $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); + if ($product->getCustomOption('simple_product') && $product->getCustomOption('simple_product')->getProduct()) { + $simpleProduct = $product->getCustomOption('simple_product')->getProduct(); + $productData['price'] = $this->priceFormatter->format((float) $simpleProduct->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); + } $productData = $this->attachCategoriesData($product, $productData); $productData = $this->parseDataLayerMapping($product, $productData);