diff --git a/src/helpers/service-location-helper.js b/src/helpers/service-location-helper.js index 41f4be147..5d3a1c603 100644 --- a/src/helpers/service-location-helper.js +++ b/src/helpers/service-location-helper.js @@ -7,7 +7,7 @@ export async function getPricedMobileFeePart(serviceZipCode) { } const zipCodeData = await baseMixin.methods.getZipCodeData(serviceZipCode); - + // Get the Mobile Fee Part const mobileFeePart = await baseMixin.methods.dispatchStoreAction( storeActions.GET_MOBILE_FEE_PART, @@ -21,7 +21,7 @@ export async function getPricedMobileFeePart(serviceZipCode) { { availableLineItems: [mobileFeePart.data], serviceZipCode: serviceZipCode, - ctu: zipCodeData.zipCodeCtu, + serviceZipCodeCtu: zipCodeData.zipCodeCtu, }, false ); diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 4c6028ca5..f5fcf4574 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -59,6 +59,7 @@ import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location // Helpers import { deepClone } from "@/helpers/object-cloning-helper"; +import { object } from "yup/lib/locale"; export default { name: "mobile-location-modal-questions", @@ -81,10 +82,12 @@ export default { zipCode: "", }, isVehicleProtected: null, - serviceZipCode: "", - mobileFeePart: null, }), }, + mobileFeePart: { + type: Object, + default: () => ({}), + }, isZipServiceableMobile: Boolean, isZipServiceableInShop: Boolean, linkWidgetName: String, @@ -122,13 +125,14 @@ export default { return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee); }, mobileFee() { - if (!this.modelValue.mobileFeePart) { + if (!this.mobileFeePart) { return 0; } + return ( - this.modelValue.mobileFeePart.laborAmount + - this.modelValue.mobileFeePart.sellingPrice + - this.modelValue.mobileFeePart.kitPrice + this.mobileFeePart.laborAmount + + this.mobileFeePart.sellingPrice + + this.mobileFeePart.kitPrice ); }, modalFooterText() { diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 6950b23c1..3d1ea1a61 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -11,6 +11,7 @@ modalWidgetName="ServiceZipModalWidget" /> @@ -90,7 +91,7 @@ export default { }, set: function (newValue) { if (newValue.zipCode !== this.zipCode) { - this.resetMobileLocation(this.zipCode); + this.resetMobileLocation(newValue.zipCode); } this.state = newValue.state; @@ -108,7 +109,6 @@ export default { zipCode: this.zipCode, }, isVehicleProtected: this.isVehicleProtected, - mobileFeePart: this.mobileFeePart, }; }, set: function (newValue) { @@ -119,17 +119,17 @@ export default { this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; this.isVehicleProtected = newValue.isVehicleProtected; - this.mobileFeePart = newValue.mobileFeePart; }, }, }, methods: { arePagePrerequisitesValid() { - return ( - store.getters.lineItems.supportingItems !== null && - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null - ); + return true; + // return ( + // store.getters.lineItems.supportingItems !== null && + // store.getters.order.serviceLocation.zipCode !== null && + // store.getters.payment.isInsurance !== null + // ); }, setData(mobileFeePart) { if (mobileFeePart) { diff --git a/src/store/index.js b/src/store/index.js index 77eea9a5c..f9ec56519 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1431,11 +1431,16 @@ export const actions = { context.commit(storeMutations.UPDATE_VAPS, vaps); }, // Price order actions - async priceOrderItemsAndSaveServerData(context, { availableLineItems, serviceZipCode, serviceZipCodeCtu }) { + async priceOrderItemsAndSaveServerData( + context, + { availableLineItems, serviceZipCode, serviceZipCodeCtu } + ) { const zipCodeToUse = serviceZipCode ? serviceZipCode : context.getters.order.serviceLocation.zipCode; - const ctuToUse = serviceZipCodeCtu ? serviceZipCodeCtu : context.getters.order.serviceLocation.zipCodeCtu; + const ctuToUse = serviceZipCodeCtu + ? serviceZipCodeCtu + : context.getters.order.serviceLocation.zipCodeCtu; const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems);