Merge pull request #1930 from Safelite/CSR-2155-fix-wrong-price-displayed
CSR-2155 fix incorrect price for afterpay packages.
This commit is contained in:
commit
ed50076e40
2 changed files with 7 additions and 11 deletions
|
|
@ -52,9 +52,7 @@ export default {
|
||||||
name: "afterpay-modal-banner",
|
name: "afterpay-modal-banner",
|
||||||
props: {
|
props: {
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
availableLineItems: Array,
|
|
||||||
lineItems: Array,
|
lineItems: Array,
|
||||||
activePromos: null,
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
|
|
@ -65,9 +63,6 @@ export default {
|
||||||
getInlineAltText,
|
getInlineAltText,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
nullSafeLineItems() {
|
|
||||||
return this.availableLineItems ?? [];
|
|
||||||
},
|
|
||||||
imageUrl() {
|
imageUrl() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "Image");
|
return this.getCmsContent(this.cmsWidgetName, "Image");
|
||||||
},
|
},
|
||||||
|
|
@ -81,8 +76,9 @@ export default {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
||||||
},
|
},
|
||||||
afterpayPrice() {
|
afterpayPrice() {
|
||||||
|
const allLineItems = getArrayOfAllLineItems(this.lineItems);
|
||||||
let price = baseMixin.methods.getTierOnePackagePrice(
|
let price = baseMixin.methods.getTierOnePackagePrice(
|
||||||
baseMixin.methods.filterOutFees(this.nullSafeLineItems)
|
baseMixin.methods.filterOutFees(allLineItems)
|
||||||
);
|
);
|
||||||
|
|
||||||
let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
|
let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
|
||||||
|
|
@ -90,9 +86,11 @@ export default {
|
||||||
price += baseMixin.methods.getTotalLineItemPrice(lineItem);
|
price += baseMixin.methods.getTotalLineItemPrice(lineItem);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.activePromos) {
|
if (this.lineItems.promos) {
|
||||||
let allLineItems = getArrayOfAllLineItems(this.lineItems);
|
const promos = getPromosThatMatchLineItemsOnOrder(
|
||||||
const promos = getPromosThatMatchLineItemsOnOrder(this.activePromos, allLineItems);
|
this.lineItems.promos,
|
||||||
|
allLineItems
|
||||||
|
);
|
||||||
promos.forEach((promo) => {
|
promos.forEach((promo) => {
|
||||||
price += baseMixin.methods.getTotalLineItemPrice(promo);
|
price += baseMixin.methods.getTotalLineItemPrice(promo);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,6 @@
|
||||||
<afterpayModalBanner
|
<afterpayModalBanner
|
||||||
v-if="!isInsuranceSelected && !isRecalibrationOnOrder"
|
v-if="!isInsuranceSelected && !isRecalibrationOnOrder"
|
||||||
cmsWidgetName="AfterpayModalWidget"
|
cmsWidgetName="AfterpayModalWidget"
|
||||||
:activePromos="lineItems.promos"
|
|
||||||
:availableLineItems="availableLineItems"
|
|
||||||
:lineItems="lineItems" />
|
:lineItems="lineItems" />
|
||||||
|
|
||||||
<recalDisclaimer
|
<recalDisclaimer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue