From 4112f09e46871db291f40dc4d034559c6c763d19 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 30 Jul 2024 14:22:51 -0400 Subject: [PATCH 1/2] CSR-2155 fix incorrect price for afterpay packages. --- .../afterpay-modal-banner.vue | 15 +++++---------- src/layouts/quote/quote.vue | 6 ++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue b/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue index 09d9ddc15..aadca0d52 100644 --- a/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue +++ b/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue @@ -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,8 @@ 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); }); @@ -125,4 +120,4 @@ export default { font-size: 0.875rem; } } - + \ No newline at end of file diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index d3553dfb4..d0bffb1ce 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -45,9 +45,7 @@ + :lineItems="lineItems" /> + \ No newline at end of file From 5bb2bf0bdd01b08bbfe36c126e38c758f8c925f8 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 30 Jul 2024 14:29:25 -0400 Subject: [PATCH 2/2] Format code. --- .../quote/afterpay-modal-banner/afterpay-modal-banner.vue | 7 +++++-- src/layouts/quote/quote.vue | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue b/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue index aadca0d52..a77bde39d 100644 --- a/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue +++ b/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue @@ -87,7 +87,10 @@ export default { }); if (this.lineItems.promos) { - const promos = getPromosThatMatchLineItemsOnOrder(this.lineItems.promos, allLineItems); + const promos = getPromosThatMatchLineItemsOnOrder( + this.lineItems.promos, + allLineItems + ); promos.forEach((promo) => { price += baseMixin.methods.getTotalLineItemPrice(promo); }); @@ -120,4 +123,4 @@ export default { font-size: 0.875rem; } } - \ No newline at end of file + diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index d0bffb1ce..8f9d256e0 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -45,7 +45,7 @@ + :lineItems="lineItems" /> \ No newline at end of file +