Skip to content

Commit

Permalink
Merge pull request #253 from florinm8/master
Browse files Browse the repository at this point in the history
Use price with currency instead base price
  • Loading branch information
jissereitsma authored Nov 12, 2024
2 parents 522ea1e + 4e29848 commit 9833ce1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DataLayer/Mapper/ProductDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9833ce1

Please sign in to comment.