From a60456993d1eaff6ab9aa80cf5c161e66c6465aa Mon Sep 17 00:00:00 2001 From: Victor Kloeppel Date: Wed, 17 Jun 2026 08:47:02 +0200 Subject: [PATCH] fixed product price --- DataLayer/Mapper/ProductDataMapper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DataLayer/Mapper/ProductDataMapper.php b/DataLayer/Mapper/ProductDataMapper.php index 65eed96d..3f3869d4 100644 --- a/DataLayer/Mapper/ProductDataMapper.php +++ b/DataLayer/Mapper/ProductDataMapper.php @@ -7,6 +7,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Catalog\Pricing\Price\FinalPrice; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Tagging\GTM\Api\Data\ProductTagInterface; use Tagging\GTM\Api\Data\TagInterface; @@ -98,7 +99,12 @@ public function mapByProduct(ProductInterface $product): array } catch (NoSuchEntityException $noSuchEntityException) { } - $productData['price'] = $this->priceFormatter->format((float)$product->getFinalPrice()); + // Use the price info final price instead of getFinalPrice(): for grouped products the + // parent product itself has no price (getFinalPrice() returns 0) and Magento resolves the + // final price to the lowest priced associated product, which is what is shown on the front-end. + $productData['price'] = $this->priceFormatter->format( + (float)$product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue() + ); $productData = $this->attachCategoriesData($product, $productData); $productData = $this->parseDataLayerMapping($product, $productData);