Skip to content

Commit 9833ce1

Browse files
authored
Merge pull request #253 from florinm8/master
Use price with currency instead base price
2 parents 522ea1e + 4e29848 commit 9833ce1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

DataLayer/Mapper/ProductDataMapper.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ public function mapByProduct(ProductInterface $product): array
8282
} catch (NoSuchEntityException $noSuchEntityException) {
8383
}
8484

85-
$productData['price'] = $this->priceFormatter->format((float)$product->getFinalPrice());
85+
$productData['price'] = $this->priceFormatter->format((float) $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue());
86+
if ($product->getCustomOption('simple_product') && $product->getCustomOption('simple_product')->getProduct()) {
87+
$simpleProduct = $product->getCustomOption('simple_product')->getProduct();
88+
$productData['price'] = $this->priceFormatter->format((float) $simpleProduct->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue());
89+
}
8690

8791
$productData = $this->attachCategoriesData($product, $productData);
8892
$productData = $this->parseDataLayerMapping($product, $productData);

0 commit comments

Comments
 (0)