diff --git a/src/helpers/recal-helper.js b/src/helpers/recal-helper.js index 0bb650ff..5b86e63a 100644 --- a/src/helpers/recal-helper.js +++ b/src/helpers/recal-helper.js @@ -120,5 +120,9 @@ export function anyPartWithRequiresRecalFlag(lineItems) { } export function hasMSRPart(lineItems) { - return lineItems?.feeItems?.some((item) => item.partNumber === partNumberStrings.RECAL_MOBILEDUAL || item.partNumber === partNumberStrings.RECAL_MOBILE) ?? false + return lineItems?.feeItems?.some((item) => isMSRPart(item)) ?? false; +} + +export function isMSRPart(part) { + return part.partNumber === partNumberStrings.RECAL_MOBILEDUAL || part.partNumber === partNumberStrings.RECAL_MOBILE; } diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 51ce0372..991f0587 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -135,7 +135,7 @@ import { getMobileZipCodeData } from '@/helpers/service-location-helper'; import { toTitleCase } from '@/helpers/text-helper.js'; -import { isRecalOrder } from '@/helpers/recal-helper'; +import { isMSRPart, isRecalOrder } from '@/helpers/recal-helper'; // Import Component import alert from '@/ux-components/alert/alert.vue'; @@ -148,6 +148,7 @@ import recalModal from '@/iss-components/recal-modal/recal-modal.vue'; import { getPricedMobileFeePart } from '@/helpers/service-location-helper'; import { processIfStatements } from '@/helpers/cms-content-helper'; import partNumberStrings from '@/constants/part-number-strings'; +import { experimentSettings } from '@/constants/experiments'; const RECAL_MODAL_REF_NAME = 'RecalModal'; @@ -294,11 +295,28 @@ export default { return this.processIfStatements(bodyText, 'custom', this.getCustomValueFromString); }, displayMSRFeeAlert() { - return this.mobileFeePart !== null && this.mobileFeePart.sellingPrice > 0 && (this.mobileFeePart.partNumber === partNumberStrings.RECAL_MOBILEDUAL || this.mobileFeePart.partNumber === partNumberStrings.RECAL_MOBILE); + if (!this.mobileFeePart || this.mobileFeePart.sellingPrice === 0 || !isMSRPart(this.mobileFeePart)) { + return false; + } + + if (this.mainStore.isITAC || this.mainStore.isNoComp) { + return true; + } + + const isSplitPayEnabled = this.getSettingValue(experimentSettings.MSR_SPLIT_PAY_ENABLED) === 'true'; + if (!isSplitPayEnabled) { + return false; + } + + if (!this.mobileFeePart.isInsurable) { + return true; + } + + return false; }, msrFeeAlertCopy() { let content = this.getCmsContent('AlertMSRFeeWidget', widgetFields.ALERT_WIDGET.BODY_TEXT); - content = content.replace('{custom:fee}', `$${this.mobileFeePart.sellingPrice.toFixed(2)}`); + content = content.replace('{custom:mobileFee}', `${this.mobileFeePart.sellingPrice.toFixed(2)}`); return content; } },