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
This commit is contained in:
Bianca Widstam
2025-08-12 12:19:02 +00:00
parent 9362d09730
commit 3262a71184
2 changed files with 17 additions and 2 deletions

View File

@@ -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({
)}
</span>
</Typography>
{showDiscounted && totalPrice.local.regularPrice ? (
{showDiscounted &&
showStrikeThroughPrice &&
totalPrice.local.regularPrice ? (
<Typography variant="Body/Paragraph/mdRegular">
<s className={styles.strikeThroughRate}>
{formatPrice(

View File

@@ -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 (
<div className={styles.wrapper} data-open={isSummaryOpen}>
@@ -126,7 +132,9 @@ export default function MobileSummary({
)}
</span>
</Typography>
{showDiscounted && totalPriceToShow.local.regularPrice ? (
{showDiscounted &&
showStrikeThroughPrice &&
totalPriceToShow.local.regularPrice ? (
<Typography variant="Body/Paragraph/mdRegular">
<s className={styles.strikeThroughRate}>
{formatPrice(