From 551cb3ed48d628a20268f976700f36662c1f6b5c Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Tue, 9 Sep 2025 06:11:10 +0000 Subject: [PATCH] Merged in fix/SW-3436-strikethrough-prices-summary (pull request #2776) fix(SW-3436): show strikethrough price if discounted * fix(SW-3436): show strikethrough price if discounted Approved-by: Linus Flood --- .../RateSummary/DesktopSummary.tsx | 37 +++++++------------ .../RoomsContainer/RateSummary/index.tsx | 1 - 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/DesktopSummary.tsx b/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/DesktopSummary.tsx index e2e12382f..47c757da1 100644 --- a/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/DesktopSummary.tsx +++ b/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/DesktopSummary.tsx @@ -21,12 +21,10 @@ export function DesktopSummary({ input, selectedRates, isSubmitting, - bookingCode, }: { selectedRates: ReturnType["selectedRates"] isSubmitting: boolean input: ReturnType["input"] - bookingCode: string }) { const intl = useIntl() const isUserLoggedIn = useIsLoggedIn() @@ -88,14 +86,6 @@ export function DesktopSummary({ const mainRoomRate = selectedRates.rates.at(0) let mainRoomCurrency = getRoomCurrency(mainRoomRate) - const totalRegularPrice = selectedRates.totalPrice.local?.regularPrice - ? selectedRates.totalPrice.local.regularPrice - : 0 - const isTotalRegularPriceGreaterThanPrice = - totalRegularPrice > selectedRates.totalPrice.local.price - const showStrikedThroughPrice = - (!!bookingCode || isUserLoggedIn) && isTotalRegularPriceGreaterThanPrice - return ( <>
@@ -168,20 +158,19 @@ export function DesktopSummary({ selectedRates.totalPrice.local.additionalPriceCurrency )} - {showStrikedThroughPrice && - selectedRates.totalPrice.local.regularPrice && ( - - {formatPrice( - intl, - selectedRates.totalPrice.local.regularPrice, - selectedRates.totalPrice.local.currency - )} - - )} + {showDiscounted && selectedRates.totalPrice.local.regularPrice && ( + + {formatPrice( + intl, + selectedRates.totalPrice.local.regularPrice, + selectedRates.totalPrice.local.currency + )} + + )} {selectedRates.totalPrice.requested ? ( {intl.formatMessage( diff --git a/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/index.tsx b/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/index.tsx index 79a91f9ee..d87019104 100644 --- a/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/index.tsx +++ b/packages/booking-flow/lib/components/SelectRate/RoomsContainer/RateSummary/index.tsx @@ -66,7 +66,6 @@ function InnerRateSummary() { isSubmitting={isSubmitting} input={input} selectedRates={selectedRates} - bookingCode={input.data?.booking.bookingCode || ""} />