diff --git a/src/helpers/service-package-helper.js b/src/helpers/service-package-helper.js index 310a87e0e..6ff937564 100644 --- a/src/helpers/service-package-helper.js +++ b/src/helpers/service-package-helper.js @@ -239,6 +239,15 @@ export function getPackageNameByType(packageType) { return package_names[packageType] || null; } +export function getDiscountPackageName(discountPackage) { + const package_names = { + ECON: packageNames.TIER_ONE, + STANDARD: packageNames.TIER_TWO, + PREMIUM: packageNames.TIER_THREE, + }; + return package_names[discountPackage] || null; +} + function maxTier(tierA, tierB) { if (tierA === packageNames.TIER_THREE || tierB === packageNames.TIER_THREE) { return packageNames.TIER_THREE; diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 403982a83..6ac7a3d9a 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -375,6 +375,7 @@ export default { }, false ); + await this.getAndSaveBillToAccountNumber(); return await this.navigateForward(carsFound); }, diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 3791359e5..9820eec12 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -128,6 +128,20 @@ export default { this.parentAccountNumber.toString(), false ); + + const billToAccountNumber = await baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.GET_BILL_TO_ACCOUNT_NUMBER, + {}, + "insurance-company", + false + ); + + baseMixin.methods.dispatchStoreAction( + storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER, + billToAccountNumber, + false + ); + navigateToHeritageFunnel({ shouldSaveSession: true, pageNameToLog: "insurance-company", diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 308180d20..2f82691ce 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -323,6 +323,7 @@ export default { false ); + await this.getAndSaveBillToAccountNumber(); return await this.navigateForward(); }, lookupVin(plate, state) { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 194243d38..74a3c65c0 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -78,7 +78,7 @@ validationRules="payment-method-required" /> 0 + ); + }, totalAmountDue() { return baseMixin.methods.getAmountDue(this.lineItems); }, 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 e475becd5..7df8dab5f 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -28,6 +28,7 @@ import { containsLineItemWithPartType, findLineItemsWithPartType, getPackageNameByType, + getDiscountPackageName, } from "@/helpers/service-package-helper"; import { getPromosThatMatchLineItemsOnOrder, @@ -161,16 +162,7 @@ export default { const discountServicePackage = experimentMixin.methods.getSettingValue( experimentSettings.PROMO_ON_PACKAGE ); - switch (discountServicePackage) { - case "ECON": - return packageNames.TIER_ONE; - case "STANDARD": - return packageNames.TIER_TWO; - case "PREMIUM": - return packageNames.TIER_THREE; - default: - return null; - } + return getDiscountPackageName(discountServicePackage); }, frontWipersApplicableForTierTwo() { return shouldFrontWipersBeAvailable( diff --git a/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue b/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue index 13ae42095..381ff4607 100644 --- a/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue +++ b/src/layouts/service-location/shop-question/shop-list-button/shop-list-button.vue @@ -8,15 +8,15 @@ :aria-label="buttonLabel" class="button-content list-button-content d-flex flex-column justify-content-center py-3 px-4">
- {{ + {{ buttonLabel }} - {{ + {{ buttonLabelSubCopy }}
{ if (customZipDataResponse) { return customZipDataResponse; diff --git a/src/layouts/service-zip/service-zip.vue b/src/layouts/service-zip/service-zip.vue index ddcc4edf0..25045af0a 100644 --- a/src/layouts/service-zip/service-zip.vue +++ b/src/layouts/service-zip/service-zip.vue @@ -198,6 +198,7 @@ export default { }, false ); + await this.getAndSaveBillToAccountNumber(); if (!zipCodeData.isValid) { this.displayInvalidZipAlert = true; diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index b63158680..6bac87c19 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -346,6 +346,7 @@ export default { false ); + await this.getAndSaveBillToAccountNumber(); return await this.navigateForward(); } diff --git a/src/mixins/vin-pages-mixin.js b/src/mixins/vin-pages-mixin.js index 75054f776..7d15066c5 100644 --- a/src/mixins/vin-pages-mixin.js +++ b/src/mixins/vin-pages-mixin.js @@ -42,5 +42,19 @@ export default { }; return vinLookupMethods[vinSelection] || null; }, + async getAndSaveBillToAccountNumber() { + const pageName = this.$options?.name; + const billToAccountNumber = await this.dispatchStoreActionWithLogging( + storeActions.GET_BILL_TO_ACCOUNT_NUMBER, + {}, + pageName, + false + ); + await this.dispatchStoreAction( + this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER, + billToAccountNumber, + false + ); + }, }, }; diff --git a/src/router/index.js b/src/router/index.js index 73605c543..218e32d35 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -115,6 +115,15 @@ const routes = [ to.query.fmgPage ); + // clear part related state because heritage selected a new vehicle + if ( + to.query.fmgPage === fmgPageValues.VEHICLE && + eval(getFunnelCookie()?.HasDelayedClaimRegistration) + ) { + console.log(new Date() + "Router: Policy Vehicle Changed"); + store.commit(storeMutations.RESET_GLASS_PARTS_STATE); + } + const pageToRedirectTo = await getPageToRouteExistingOrderTo(to); // This logic may determine that the user should be sent to heritage -- if so, do that here. diff --git a/src/store/index.js b/src/store/index.js index 7fe13f59b..ea025f1d4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2803,10 +2803,8 @@ export const actions = { pageNameToLog, } ) { - // Cash orders default to 87291 - update if/when more detailed - // billToAccountNumbers are needed for cash - if (parentAccountNumber == applicationConfig.CASH_PARENT_ACCOUNT_NUMBER) { - return applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER; + if (!parentAccountNumber) { + parentAccountNumber = applicationConfig.CASH_PARENT_ACCOUNT_NUMBER; } const queryString = `ParentAccountNumber=${parentAccountNumber}` + diff --git a/vue.config.js b/vue.config.js index b111f079d..03c72c59b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,7 +6,7 @@ process.env.VUE_APP_CURRENT_ENVIRONMENT = "Localhost"; process.env.VUE_APP_MY_ACCOUNT = "https://myaccountdev.safelite.com/"; //process.env.VUE_APP_SAFELITE_HOP = "http://localhost:60966/fmgCheckoutShared.aspx"; -process.env.VUE_APP_SAFELITE_HOP = "https://sv2-safelitehop-sys.safelite.com/fmgCheckoutShared.aspx"; +process.env.VUE_APP_SAFELITE_HOP = "https://sv2-safelitehop-dev.safelite.com/fmgCheckoutShared.aspx"; // GA & GTM process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY =