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",
|
||||
props: {
|
||||
cmsWidgetName: String,
|
||||
availableLineItems: Array,
|
||||
lineItems: Array,
|
||||
activePromos: null,
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
|
|
@ -65,9 +63,6 @@ export default {
|
|||
getInlineAltText,
|
||||
},
|
||||
computed: {
|
||||
nullSafeLineItems() {
|
||||
return this.availableLineItems ?? [];
|
||||
},
|
||||
imageUrl() {
|
||||
return this.getCmsContent(this.cmsWidgetName, "Image");
|
||||
},
|
||||
|
|
@ -81,8 +76,9 @@ export default {
|
|||
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
||||
},
|
||||
afterpayPrice() {
|
||||
const allLineItems = getArrayOfAllLineItems(this.lineItems);
|
||||
let price = baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(this.nullSafeLineItems)
|
||||
baseMixin.methods.filterOutFees(allLineItems)
|
||||
);
|
||||
|
||||
let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
|
||||
|
|
@ -90,9 +86,11 @@ export default {
|
|||
price += baseMixin.methods.getTotalLineItemPrice(lineItem);
|
||||
});
|
||||
|
||||
if (this.activePromos) {
|
||||
let allLineItems = getArrayOfAllLineItems(this.lineItems);
|
||||
const promos = getPromosThatMatchLineItemsOnOrder(this.activePromos, allLineItems);
|
||||
if (this.lineItems.promos) {
|
||||
const promos = getPromosThatMatchLineItemsOnOrder(
|
||||
this.lineItems.promos,
|
||||
allLineItems
|
||||
);
|
||||
promos.forEach((promo) => {
|
||||
price += baseMixin.methods.getTotalLineItemPrice(promo);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -45,8 +45,6 @@
|
|||
<afterpayModalBanner
|
||||
v-if="!isInsuranceSelected && !isRecalibrationOnOrder"
|
||||
cmsWidgetName="AfterpayModalWidget"
|
||||
:activePromos="lineItems.promos"
|
||||
:availableLineItems="availableLineItems"
|
||||
:lineItems="lineItems" />
|
||||
|
||||
<recalDisclaimer
|
||||
|
|
|
|||
Loading…
Reference in a new issue