Merge pull request #3227 from Safelite/feature/CASH-2872

CASH-2872: Add QPD and Replace Fee to cart/products datalayer objects
This commit is contained in:
Chris 2026-06-15 11:38:35 -04:00 committed by GitHub
commit 28d5b23372
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -605,8 +605,13 @@ export default {
[part],
false
);
let isQuotePageDiscount = productType == partTypeStrings.QUOTE_PAGE_DISCOUNT;
if (productSku == "DISCOUNT" || productType == "SERVICE PACKAGE DISCOUNT") {
if (
productSku == "DISCOUNT" ||
productType == "SERVICE PACKAGE DISCOUNT" ||
isQuotePageDiscount
) {
if (coupon) {
coupon += ",";
}
@ -617,6 +622,7 @@ export default {
}
discount += productPrice * -1;
subTotal += isQuotePageDiscount ? productPrice : 0;
} else {
products.push({
productType: productType,
@ -666,6 +672,12 @@ export default {
var repairFee = supportingItems.filter(function (lineItem) {
return lineItem.partType.indexOf("REPAIR FEE") !== -1;
});
var replaceFee = supportingItems.filter(function (lineItem) {
return lineItem.partType.indexOf("REPLACE FEE") !== -1;
});
var quotePageDiscount = supportingItems.filter(function (lineItem) {
return lineItem.partType.indexOf(partTypeStrings.QUOTE_PAGE_DISCOUNT) !== -1;
});
var vaps =
submittedOrder.lineItems && submittedOrder.lineItems.vaps
@ -704,6 +716,12 @@ export default {
if (rainRepel) {
combinedLineItems = combinedLineItems.concat(rainRepel);
}
if (replaceFee) {
combinedLineItems = combinedLineItems.concat(replaceFee);
}
if (quotePageDiscount) {
combinedLineItems = combinedLineItems.concat(quotePageDiscount);
}
//Remove child Parts if any
combinedLineItems.forEach((lineItem) => {