Merge pull request #1936 from Safelite/feature/CSR-2155

CSR-2155
This commit is contained in:
AMSNEHA 2024-08-08 17:10:17 +05:30 committed by GitHub
commit 9fd4ffd991
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 15 deletions

View file

@ -76,7 +76,11 @@ export default {
return this.getCmsContent(this.cmsWidgetName, "SubheaderText"); return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
}, },
afterpayPrice() { 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( let price = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(allLineItems) baseMixin.methods.filterOutFees(allLineItems)
); );
@ -87,6 +91,7 @@ export default {
}); });
if (this.lineItems.promos) { if (this.lineItems.promos) {
let allLineItems = getArrayOfAllLineItems(this.lineItems);
const promos = getPromosThatMatchLineItemsOnOrder( const promos = getPromosThatMatchLineItemsOnOrder(
this.lineItems.promos, this.lineItems.promos,
allLineItems allLineItems

View file

@ -75,21 +75,23 @@ export default {
const servicePackageDiscountPartInSelectedPackage = const servicePackageDiscountPartInSelectedPackage =
this.getServicePackageDiscountPartForSelectedPackage(newValue); this.getServicePackageDiscountPartForSelectedPackage(newValue);
let supportingItems = this.supportingLineItems; let supportingItems = this.supportingLineItems;
if (servicePackageDiscountPartInSelectedPackage?.length > 0) { if (
supportingItems?.push(servicePackageDiscountPartInSelectedPackage[0]); containsLineItemWithPartType(
} else { partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
if ( supportingItems
supportingItems?.length > 0 && )
containsLineItemWithPartType( ) {
partTypeStrings.SERVICE_PACKAGE_DISCOUNT, supportingItems = supportingItems.filter(
supportingItems (item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT
) );
) {
supportingItems = supportingItems.filter(
(item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT
);
}
} }
if (
servicePackageDiscountPartInSelectedPackage?.length > 0 &&
supportingItems != null
) {
supportingItems.push(servicePackageDiscountPartInSelectedPackage[0]);
}
this.$emit("servicePackageDiscountSelected", supportingItems); this.$emit("servicePackageDiscountSelected", supportingItems);
}, },
}, },