From 3262a7118456aa99da89964e045eb43062b1d2c8 Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Tue, 12 Aug 2025 12:19:02 +0000 Subject: [PATCH] Merged in fix/SW-3198-strikethrough-price-mobile (pull request #2622) fix(SW-3198): show strikethrough price only if price is higher than regular price * fix(SW-3198): show strikethrough price only if price is higher than regular price * fix(SW-3198): reverse logic Approved-by: Hrishikesh Vaipurkar --- .../RateSummary/MobileSummary/Content/index.tsx | 9 ++++++++- .../RoomsContainer/RateSummary/MobileSummary/index.tsx | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Content/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Content/index.tsx index 65c48491d..c21c96946 100644 --- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Content/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Content/index.tsx @@ -57,6 +57,11 @@ export default function SummaryContent({ (r) => r && isBookingCodeRate(r.roomRate) ) const showDiscounted = containsBookingCodeRate || isMember + const totalRegularPrice = totalPrice.local?.regularPrice + ? totalPrice.local.regularPrice + : 0 + + const showStrikeThroughPrice = totalRegularPrice > totalPrice.local.price const priceDetailsRooms = mapToPrice(rateSummary, booking.rooms, isMember) return ( @@ -163,7 +168,9 @@ export default function SummaryContent({ )} - {showDiscounted && totalPrice.local.regularPrice ? ( + {showDiscounted && + showStrikeThroughPrice && + totalPrice.local.regularPrice ? ( {formatPrice( diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/index.tsx index de2d3fb7f..98123bcc7 100644 --- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/index.tsx @@ -83,6 +83,12 @@ export default function MobileSummary({ (r) => r && isBookingCodeRate(r.product) ) const showDiscounted = containsBookingCodeRate || isUserLoggedIn + const totalRegularPrice = totalPriceToShow.local?.regularPrice + ? totalPriceToShow.local.regularPrice + : 0 + + const showStrikeThroughPrice = + totalRegularPrice > totalPriceToShow.local.price return (
@@ -126,7 +132,9 @@ export default function MobileSummary({ )} - {showDiscounted && totalPriceToShow.local.regularPrice ? ( + {showDiscounted && + showStrikeThroughPrice && + totalPriceToShow.local.regularPrice ? ( {formatPrice(