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 a77bde39d..512d0f577 100644 --- a/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue +++ b/src/layouts/quote/afterpay-modal-banner/afterpay-modal-banner.vue @@ -76,7 +76,11 @@ export default { return this.getCmsContent(this.cmsWidgetName, "SubheaderText"); }, afterpayPrice() { - const allLineItems = getArrayOfAllLineItems(this.lineItems); + let allLineItems = getArrayOfAllLineItems(this.lineItems); + if (this.lineItems.promos) { + allLineItems = allLineItems?.filter((item) => item.partType !== "PROMO_DISCOUNT"); + } + let price = baseMixin.methods.getTierOnePackagePrice( baseMixin.methods.filterOutFees(allLineItems) ); @@ -87,6 +91,7 @@ export default { }); if (this.lineItems.promos) { + let allLineItems = getArrayOfAllLineItems(this.lineItems); const promos = getPromosThatMatchLineItemsOnOrder( this.lineItems.promos, allLineItems diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index 94cbb7685..c4e73b451 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -75,21 +75,23 @@ export default { const servicePackageDiscountPartInSelectedPackage = this.getServicePackageDiscountPartForSelectedPackage(newValue); let supportingItems = this.supportingLineItems; - if (servicePackageDiscountPartInSelectedPackage?.length > 0) { - supportingItems?.push(servicePackageDiscountPartInSelectedPackage[0]); - } else { - if ( - supportingItems?.length > 0 && - containsLineItemWithPartType( - partTypeStrings.SERVICE_PACKAGE_DISCOUNT, - supportingItems - ) - ) { - supportingItems = supportingItems.filter( - (item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT - ); - } + if ( + containsLineItemWithPartType( + partTypeStrings.SERVICE_PACKAGE_DISCOUNT, + supportingItems + ) + ) { + supportingItems = supportingItems.filter( + (item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT + ); } + if ( + servicePackageDiscountPartInSelectedPackage?.length > 0 && + supportingItems != null + ) { + supportingItems.push(servicePackageDiscountPartInSelectedPackage[0]); + } + this.$emit("servicePackageDiscountSelected", supportingItems); }, },