Merged in fix/SW-2764-remove-ancillaries-breakfast-selection (pull request #2122)

fix(SW-2764): Tracking - remove ancillaries array if no breakfast selected

* fix(SW-2764): remove ancillaries array if no breakfast selected


Approved-by: Tobias Johansson
Approved-by: Joakim Jäderberg
This commit is contained in:
Bianca Widstam
2025-05-16 11:42:56 +00:00
committed by Joakim Jäderberg
parent f40a666170
commit 24e7ab4b71

View File

@@ -47,18 +47,20 @@ export function trackBreakfastSelection({
selection: {
name: "breakfast options selection click",
},
ancillaries: [
{
hotelId: hotelId,
productCategory: "",
productId: breakfastPackage.code,
productUnits: units,
productPrice: units > 0 ? breakfastPackage.localPrice.price * units : 0,
productPoints: 0,
productType: "food",
productName: breakfastPackage.packageType,
},
],
...(units > 0 && {
ancillaries: [
{
hotelId,
productCategory: "",
productId: breakfastPackage.code,
productUnits: units,
productPrice: breakfastPackage.localPrice.price * units,
productPoints: 0,
productType: "food",
productName: breakfastPackage.packageType,
},
],
}),
pageInfo: {
pageName: "hotelreservation|breakfast",
pageType: "bookingbreakfastpage",