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 productType = part.partType;
|
||||
let promoCode = part.promoCode;
|
||||
let productPrice = baseMixin.methods
|
||||
.getTotalPriceOfAllLineItemsAndChildParts([part], false)
|
||||
.toFixed(2);
|
||||
let productPrice = baseMixin.methods.getTotalPriceOfAllLineItemsAndChildParts(
|
||||
[part],
|
||||
false
|
||||
);
|
||||
|
||||
if (productSku == "DISCOUNT" || productType == "SERVICE PACKAGE DISCOUNT") {
|
||||
if (coupon) {
|
||||
|
|
@ -425,22 +426,23 @@ export default {
|
|||
} else {
|
||||
coupon += productSku;
|
||||
}
|
||||
discount = discount + parseFloat(productPrice) * -1;
|
||||
|
||||
discount += productPrice * -1;
|
||||
} else {
|
||||
products.push({
|
||||
productType: productType,
|
||||
productSku: productSku,
|
||||
productPrice: productPrice.toString(),
|
||||
productPrice: productPrice.toFixed(2),
|
||||
productQuantity: "1",
|
||||
});
|
||||
subTotal += parseFloat(productPrice);
|
||||
subTotal += productPrice;
|
||||
}
|
||||
}
|
||||
pushToDataLayerIfDefined({
|
||||
productArray: {
|
||||
coupon: coupon,
|
||||
discount: discount.toString(),
|
||||
subTotal: subTotal.toString(),
|
||||
discount: discount.toFixed(2),
|
||||
subTotal: subTotal.toFixed(2),
|
||||
products: products,
|
||||
},
|
||||
});
|
||||
|
|
@ -564,7 +566,7 @@ export default {
|
|||
const filteredCookie = sortedCookies?.find(
|
||||
(x) => x.tagEvent?.length > 0 && x.batchEvent?.length > 0
|
||||
);
|
||||
if (filteredCookie?.length > 0) {
|
||||
if (isDefined(filteredCookie)) {
|
||||
cjEvent = filteredCookie.tagEvent;
|
||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||
|
|
|
|||
Loading…
Reference in a new issue