From 3962ecd858e2d6cea109c5f42ec9da97d9028bd3 Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Thu, 30 Oct 2025 07:15:12 +0000 Subject: [PATCH] Merged in feat/BOOK-426-campaign-tag-select-hotel (pull request #3037) Feat/BOOK-426 campaign tag select hotel * fix(BOOK-426): do not show campaign tag if a regular booking code is used and the rate is a campaign * fix(BOOK-426): if no availability show booking code striketrough as default Approved-by: Erik Tiekstra --- .../lib/components/HotelCardListing/index.tsx | 20 ++++++++++--------- .../lib/components/HotelCard/index.tsx | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/booking-flow/lib/components/HotelCardListing/index.tsx b/packages/booking-flow/lib/components/HotelCardListing/index.tsx index 40f3ed82b..100b0d7ba 100644 --- a/packages/booking-flow/lib/components/HotelCardListing/index.tsx +++ b/packages/booking-flow/lib/components/HotelCardListing/index.tsx @@ -83,17 +83,19 @@ export default function HotelCardListing({ isBookingCodeRateAvailable && activeCodeFilter === BookingCodeFilterEnum.Discounted + const hotelsWithBookingCode = hotelData.filter( + (hotel) => hotel.availability?.bookingCode + ) const isCampaignWithBookingCode = !!bookingCode && - hotelData - .filter((hotel) => hotel.availability.bookingCode) - .every( - (hotel) => - hotel.availability.productType?.public?.rateType === - RateTypeEnum.PublicPromotion || - hotel.availability.productType?.member?.rateType === - RateTypeEnum.PublicPromotion - ) + hotelsWithBookingCode.length > 0 && + hotelsWithBookingCode.every( + (hotel) => + hotel.availability.productType?.public?.rateType === + RateTypeEnum.PublicPromotion || + hotel.availability.productType?.member?.rateType === + RateTypeEnum.PublicPromotion + ) const unfilteredHotelCount = showOnlyBookingCodeRates ? hotelData.filter((hotel) => hotel.availability.bookingCode).length diff --git a/packages/design-system/lib/components/HotelCard/index.tsx b/packages/design-system/lib/components/HotelCard/index.tsx index c2c2af3ef..faeae8207 100644 --- a/packages/design-system/lib/components/HotelCard/index.tsx +++ b/packages/design-system/lib/components/HotelCard/index.tsx @@ -279,7 +279,7 @@ export const HotelCard = memo( isCampaignUnavailable={ isCampaignWithBookingCode && fullPrice } - isCampaign={isCampaign} + isCampaign={isCampaign && !(fullPrice && bookingCode)} /> )} {(!isUserLoggedIn ||