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:
@@ -57,6 +57,11 @@ export default function SummaryContent({
|
|||||||
(r) => r && isBookingCodeRate(r.roomRate)
|
(r) => r && isBookingCodeRate(r.roomRate)
|
||||||
)
|
)
|
||||||
const showDiscounted = containsBookingCodeRate || isMember
|
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)
|
const priceDetailsRooms = mapToPrice(rateSummary, booking.rooms, isMember)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -163,7 +168,9 @@ export default function SummaryContent({
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
{showDiscounted && totalPrice.local.regularPrice ? (
|
{showDiscounted &&
|
||||||
|
showStrikeThroughPrice &&
|
||||||
|
totalPrice.local.regularPrice ? (
|
||||||
<Typography variant="Body/Paragraph/mdRegular">
|
<Typography variant="Body/Paragraph/mdRegular">
|
||||||
<s className={styles.strikeThroughRate}>
|
<s className={styles.strikeThroughRate}>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ export default function MobileSummary({
|
|||||||
(r) => r && isBookingCodeRate(r.product)
|
(r) => r && isBookingCodeRate(r.product)
|
||||||
)
|
)
|
||||||
const showDiscounted = containsBookingCodeRate || isUserLoggedIn
|
const showDiscounted = containsBookingCodeRate || isUserLoggedIn
|
||||||
|
const totalRegularPrice = totalPriceToShow.local?.regularPrice
|
||||||
|
? totalPriceToShow.local.regularPrice
|
||||||
|
: 0
|
||||||
|
|
||||||
|
const showStrikeThroughPrice =
|
||||||
|
totalRegularPrice > totalPriceToShow.local.price
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper} data-open={isSummaryOpen}>
|
<div className={styles.wrapper} data-open={isSummaryOpen}>
|
||||||
@@ -126,7 +132,9 @@ export default function MobileSummary({
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
{showDiscounted && totalPriceToShow.local.regularPrice ? (
|
{showDiscounted &&
|
||||||
|
showStrikeThroughPrice &&
|
||||||
|
totalPriceToShow.local.regularPrice ? (
|
||||||
<Typography variant="Body/Paragraph/mdRegular">
|
<Typography variant="Body/Paragraph/mdRegular">
|
||||||
<s className={styles.strikeThroughRate}>
|
<s className={styles.strikeThroughRate}>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
|
|||||||
Reference in New Issue
Block a user