feat: add support for bought children breakfast package
This commit is contained in:
committed by
Simon.Emanuelsson
parent
aceb88cb1a
commit
b7c78a53b5
@@ -10,10 +10,13 @@ import Row from "./Row"
|
||||
export default function Breakfast() {
|
||||
const intl = useIntl()
|
||||
|
||||
const { breakfast, rateDefinition } = useMyStayStore((state) => ({
|
||||
breakfast: state.bookedRoom.breakfast,
|
||||
rateDefinition: state.bookedRoom.rateDefinition,
|
||||
}))
|
||||
const { breakfast, breakfastChildren, rateDefinition } = useMyStayStore(
|
||||
(state) => ({
|
||||
breakfast: state.bookedRoom.breakfast,
|
||||
breakfastChildren: state.bookedRoom.breakfastChildren,
|
||||
rateDefinition: state.bookedRoom.rateDefinition,
|
||||
})
|
||||
)
|
||||
|
||||
let breakfastPrice = intl.formatMessage({
|
||||
defaultMessage: "No breakfast",
|
||||
@@ -23,9 +26,10 @@ export default function Breakfast() {
|
||||
defaultMessage: "Included",
|
||||
})
|
||||
} else if (breakfast) {
|
||||
const childPrice = breakfastChildren?.localPrice.totalPrice || 0
|
||||
breakfastPrice = formatPrice(
|
||||
intl,
|
||||
breakfast.localPrice.totalPrice,
|
||||
breakfast.localPrice.totalPrice + childPrice,
|
||||
breakfast.localPrice.currency
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user