Merged in feat/SW-1589-implement-booking-code-enter (pull request #1368)
Feat/SW-1589 implement booking code enter * feat: SW-1589 Booking code rate implementation * feat: SW-1589 Optimized price display * feat: SW-1589 Display standard price * feat: SW-1589 Fixed rate title issue Approved-by: Niclas Edenvin
This commit is contained in:
@@ -255,6 +255,7 @@ export default function Summary({
|
||||
}))}
|
||||
totalPrice={totalPrice}
|
||||
vat={vat}
|
||||
bookingCode={booking.bookingCode}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -269,6 +270,15 @@ export default function Summary({
|
||||
totalPrice.local.currency
|
||||
)}
|
||||
</Body>
|
||||
{booking.bookingCode && totalPrice.local.regularPrice && (
|
||||
<Caption color="uiTextMediumContrast" striked={true}>
|
||||
{formatPrice(
|
||||
intl,
|
||||
totalPrice.local.regularPrice,
|
||||
totalPrice.local.currency
|
||||
)}
|
||||
</Caption>
|
||||
)}
|
||||
{totalPrice.requested && (
|
||||
<Caption color="uiTextMediumContrast">
|
||||
{intl.formatMessage(
|
||||
|
||||
@@ -53,6 +53,7 @@ export default function RateSummary({ isUserLoggedIn }: RateSummaryProps) {
|
||||
const checkInDate = new Date(roomsAvailability.checkInDate)
|
||||
const checkOutDate = new Date(roomsAvailability.checkOutDate)
|
||||
const nights = dt(checkOutDate).diff(dt(checkInDate), "days")
|
||||
const bookingCode = params.get("bookingCode")
|
||||
|
||||
const totalNights = intl.formatMessage(
|
||||
{ id: "{totalNights, plural, one {# night} other {# nights}}" },
|
||||
@@ -224,6 +225,19 @@ export default function RateSummary({ isUserLoggedIn }: RateSummaryProps) {
|
||||
totalPriceToShow.local.currency
|
||||
)}
|
||||
</Subtitle>
|
||||
{bookingCode && totalPriceToShow.local.regularPrice && (
|
||||
<Caption
|
||||
textAlign="right"
|
||||
color="uiTextMediumContrast"
|
||||
striked={true}
|
||||
>
|
||||
{formatPrice(
|
||||
intl,
|
||||
totalPriceToShow.local.regularPrice,
|
||||
totalPriceToShow.local.currency
|
||||
)}
|
||||
</Caption>
|
||||
)}
|
||||
{totalPriceToShow.requested ? (
|
||||
<Body color="uiTextMediumContrast">
|
||||
{intl.formatMessage(
|
||||
|
||||
@@ -34,11 +34,17 @@ export const calculateTotalPrice = (
|
||||
petRoomPrice = Number(petRoomPackage.localPrice.totalPrice)
|
||||
}
|
||||
|
||||
const regularPrice = rate.localPrice.regularPricePerStay
|
||||
? (total.local.regularPrice || 0) +
|
||||
(rate.localPrice.regularPricePerStay || 0)
|
||||
: undefined
|
||||
|
||||
return {
|
||||
local: {
|
||||
currency: rate.localPrice.currency,
|
||||
price:
|
||||
total.local.price + rate.localPrice.pricePerStay + petRoomPrice,
|
||||
regularPrice,
|
||||
},
|
||||
requested: rate.requestedPrice
|
||||
? {
|
||||
@@ -56,6 +62,7 @@ export const calculateTotalPrice = (
|
||||
currency: (selectedRateSummary[0].public?.localPrice.currency ||
|
||||
selectedRateSummary[0].member?.localPrice.currency)!,
|
||||
price: 0,
|
||||
regularPrice: undefined,
|
||||
},
|
||||
requested: undefined,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user