From 8bf64643ca6eb0b733408c4349a2fa65994bce96 Mon Sep 17 00:00:00 2001 From: Minojhini Valaiyapathi Date: Fri, 9 May 2025 10:48:09 -0400 Subject: [PATCH] CASH-535 - Moved saving the vuex code functionality from order helper to quote page for cashPriceSubTotal. --- .../heritage-integration/order-helper.js | 16 ---------------- src/layouts/quote/quote.vue | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index 11750108c..76729e49f 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -83,22 +83,6 @@ export async function saveSession({ if (!store.getters.applicationUser.savedSessionId || shouldAwaitSaveSessionQueue) { await saveSessionPromise; } - - const lineItems = store.getters.order?.lineItems ?? {}; - const combinedLineItems = [ - ...(lineItems.glassParts || []), - ...(lineItems.supportingItems || []), - ...(lineItems.vaps || []), - ...(lineItems.promos || []), - ]; - - const cashPriceSubtotal = combinedLineItems.length - ? baseMixin.methods - .getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false) - .toFixed(2) - : ""; - - store.commit(storeMutations.UPDATE_CASH_PRICE_SUBTOTAL, cashPriceSubtotal); } export async function submitWorkOrder({ diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 57c0178e3..47b3e7375 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -168,6 +168,7 @@ import { } from "@/helpers/heritage-integration/cookie-helper"; import { showFmgLoadingModal } from "@/helpers/loading-modal-helper"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; +import { storeMutations } from "@/constants/store-mutations"; defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); @@ -766,6 +767,22 @@ export default { this.$route ); } + + const lineItems = store.getters.order?.lineItems ?? {}; + const combinedLineItems = [ + ...(lineItems.glassParts || []), + ...(lineItems.supportingItems || []), + ...(lineItems.vaps || []), + ...(lineItems.promos || []), + ]; + + const cashPriceSubtotal = combinedLineItems.length + ? baseMixin.methods + .getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false) + .toFixed(2) + : ""; + + store.commit(storeMutations.UPDATE_CASH_PRICE_SUBTOTAL, cashPriceSubtotal); }, attachCustomEventsForAnalytics() { this.prependActionToMethod(this, this.forwardButtonAction, () => {