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: { selection: {
name: "breakfast options selection click", name: "breakfast options selection click",
}, },
...(units > 0 && {
ancillaries: [ ancillaries: [
{ {
hotelId: hotelId, hotelId,
productCategory: "", productCategory: "",
productId: breakfastPackage.code, productId: breakfastPackage.code,
productUnits: units, productUnits: units,
productPrice: units > 0 ? breakfastPackage.localPrice.price * units : 0, productPrice: breakfastPackage.localPrice.price * units,
productPoints: 0, productPoints: 0,
productType: "food", productType: "food",
productName: breakfastPackage.packageType, productName: breakfastPackage.packageType,
}, },
], ],
}),
pageInfo: { pageInfo: {
pageName: "hotelreservation|breakfast", pageName: "hotelreservation|breakfast",
pageType: "bookingbreakfastpage", pageType: "bookingbreakfastpage",