From 71fb9bafcd78a706032d4a46d2d5ee9fe48cd654 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Thu, 11 Sep 2025 06:30:10 +0200 Subject: [PATCH] feat(ui): add original price display for rebated products --- src/components/ProductDetailPage.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/components/ProductDetailPage.js b/src/components/ProductDetailPage.js index f7de9ad..fc44735 100644 --- a/src/components/ProductDetailPage.js +++ b/src/components/ProductDetailPage.js @@ -713,6 +713,16 @@ class ProductDetailPage extends Component { currency: "EUR", }).format(product.price); + let originalPriceWithTax = null; + if (product.rebate && product.rebate > 0) { + const rebatePct = product.rebate / 100; + const originalPrice = Math.round((product.price / (1 - rebatePct)) * 10) / 10; + originalPriceWithTax = new Intl.NumberFormat("de-DE", { + style: "currency", + currency: "EUR", + }).format(originalPrice); + } + return ( + {originalPriceWithTax && ( + + {originalPriceWithTax} + + )} {priceWithTax}