Merge pull request #1988 from Safelite/feature/Digital/CSR-1629
CSR-1629
This commit is contained in:
commit
0ce288d714
1 changed files with 11 additions and 9 deletions
|
|
@ -412,9 +412,10 @@ export default {
|
||||||
let productSku = part.partNumber;
|
let productSku = part.partNumber;
|
||||||
let productType = part.partType;
|
let productType = part.partType;
|
||||||
let promoCode = part.promoCode;
|
let promoCode = part.promoCode;
|
||||||
let productPrice = baseMixin.methods
|
let productPrice = baseMixin.methods.getTotalPriceOfAllLineItemsAndChildParts(
|
||||||
.getTotalPriceOfAllLineItemsAndChildParts([part], false)
|
[part],
|
||||||
.toFixed(2);
|
false
|
||||||
|
);
|
||||||
|
|
||||||
if (productSku == "DISCOUNT" || productType == "SERVICE PACKAGE DISCOUNT") {
|
if (productSku == "DISCOUNT" || productType == "SERVICE PACKAGE DISCOUNT") {
|
||||||
if (coupon) {
|
if (coupon) {
|
||||||
|
|
@ -425,22 +426,23 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
coupon += productSku;
|
coupon += productSku;
|
||||||
}
|
}
|
||||||
discount = discount + parseFloat(productPrice) * -1;
|
|
||||||
|
discount += productPrice * -1;
|
||||||
} else {
|
} else {
|
||||||
products.push({
|
products.push({
|
||||||
productType: productType,
|
productType: productType,
|
||||||
productSku: productSku,
|
productSku: productSku,
|
||||||
productPrice: productPrice.toString(),
|
productPrice: productPrice.toFixed(2),
|
||||||
productQuantity: "1",
|
productQuantity: "1",
|
||||||
});
|
});
|
||||||
subTotal += parseFloat(productPrice);
|
subTotal += productPrice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pushToDataLayerIfDefined({
|
pushToDataLayerIfDefined({
|
||||||
productArray: {
|
productArray: {
|
||||||
coupon: coupon,
|
coupon: coupon,
|
||||||
discount: discount.toString(),
|
discount: discount.toFixed(2),
|
||||||
subTotal: subTotal.toString(),
|
subTotal: subTotal.toFixed(2),
|
||||||
products: products,
|
products: products,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -564,7 +566,7 @@ export default {
|
||||||
const filteredCookie = sortedCookies?.find(
|
const filteredCookie = sortedCookies?.find(
|
||||||
(x) => x.tagEvent?.length > 0 && x.batchEvent?.length > 0
|
(x) => x.tagEvent?.length > 0 && x.batchEvent?.length > 0
|
||||||
);
|
);
|
||||||
if (filteredCookie?.length > 0) {
|
if (isDefined(filteredCookie)) {
|
||||||
cjEvent = filteredCookie.tagEvent;
|
cjEvent = filteredCookie.tagEvent;
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue