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}