Merge pull request #2001 from Safelite/feature/CSR-2199

CSR-2199
This commit is contained in:
AMSNEHA 2024-09-26 18:15:14 +05:30 committed by GitHub
commit ccdb736746
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 1 deletions

View file

@ -23,6 +23,7 @@ const GaActions = {
SUBMITTED: "Submitted",
DISPLAYED: "Displayed",
CASH_QUOTE_DISPLAYED: "Cash quote displayed",
SERVICE_PACKAGE_PRICE: "Service package price",
MOBILE_AVAILABLE: "mobile_available",
SHOPS_FIRST_DISPLAYED: "shops_first_displayed",
MORE_LOCATIONS_CLICKED: "more_locations_clicked",

View file

@ -128,7 +128,10 @@ import { queryStrings } from "@/constants/query-strings";
import { getQuerystringParameter } from "@/helpers/querystring-helper";
import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-modal-question";
import { partTypeStrings } from "@/constants/part-type-strings";
import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
import {
containsLineItemWithPartType,
findLineItemsWithPartType,
} from "@/helpers/service-package-helper";
import { nextTick } from "vue";
import { packageNames } from "@/constants/package-names";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
@ -401,6 +404,18 @@ export default {
this?.availableLineItems
);
},
isServicePackageDiscountOnOrder() {
return containsLineItemWithPartType(
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
this.availableLineItems
);
},
servicePackageDiscountParts() {
return findLineItemsWithPartType(
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
this.availableLineItems
);
},
shouldHideRecalibration() {
return (
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() ===
@ -563,6 +578,46 @@ export default {
);
}
});
this.$nextTick(() => {
const availablePackageNames = this.$refs.servicePackage.servicePackageAnswers;
var eventLabel = "";
availablePackageNames?.forEach((tier) => {
if (tier) {
let lineItemsToPrice = this.availableLineItems;
if (this.isRecalibrationOnOrder && this.shouldHideRecalibration) {
lineItemsToPrice = lineItemsToPrice?.filter((item) => {
return item.partType != partTypeStrings.RECALIBRATION;
});
}
if (this.isServicePackageDiscountOnOrder) {
lineItemsToPrice = lineItemsToPrice?.filter((item) => {
return (
item.partType != this.servicePackageDiscountParts[0].partType
);
});
}
let price = 0;
if (tier.value == "TierTwo" && this.isServicePackageDiscountOnOrder) {
lineItemsToPrice.push(...this.servicePackageDiscountParts);
}
price += baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(lineItemsToPrice)
);
price += this.$refs.servicePackage.getVapsPrice(tier.value);
const formattedPrice = parseFloat(price).toFixed(2);
eventLabel += tier.value + "_" + formattedPrice;
}
eventLabel += ",";
});
eventLabel = eventLabel.slice(0, -1);
this.pushEventToGA(
"quote",
this.GaActions.SERVICE_PACKAGE_PRICE,
eventLabel,
true
);
});
},
},
mounted() {

View file

@ -211,6 +211,13 @@ export default {
payload.glassToReplace = glassString;
}
//EON
if (order.eon) {
payload.eon = order.eon;
} else {
payload.eon = "";
}
// Work Order Id
if (order.workOrderId) {
const parsedId = parseInt(order.workOrderId);