Updates to some event pricing output and adding ShopSelection event.
This commit is contained in:
parent
0a040371eb
commit
828167813c
4 changed files with 24 additions and 3 deletions
|
|
@ -28,6 +28,20 @@ export function getServiceLineItems(order) {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array containing only the
|
||||||
|
* @param {object} order order object
|
||||||
|
* @returns {[]} array of service line items
|
||||||
|
*/
|
||||||
|
export function getAvailableLineItems(order) {
|
||||||
|
const { glassParts, supportingItems } = getLineItems(order);
|
||||||
|
const availableLineItems = [
|
||||||
|
...(glassParts ?? []),
|
||||||
|
...(supportingItems ?? [])
|
||||||
|
];
|
||||||
|
return availableLineItems;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array containing only the non-service line items (Vaps and Fees)
|
* Returns an array containing only the non-service line items (Vaps and Fees)
|
||||||
* @param {object} order order object
|
* @param {object} order order object
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ import widgetFields from '@/constants/cms-widget-fields.js';
|
||||||
import { formatAmountInDollars, createUnorderedListFromStringOfParagraphs, createOrderedListFromStringOfParagraphs } from '@/helpers/text-helper.js';
|
import { formatAmountInDollars, createUnorderedListFromStringOfParagraphs, createOrderedListFromStringOfParagraphs } from '@/helpers/text-helper.js';
|
||||||
import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
||||||
import { getPriceOfLineItems } from '@/helpers/price-calculator';
|
import { getPriceOfLineItems } from '@/helpers/price-calculator';
|
||||||
|
import { getAvailableLineItems } from '@/helpers/cart-helper';
|
||||||
import coverageStatuses from '@/constants/coverage-statuses';
|
import coverageStatuses from '@/constants/coverage-statuses';
|
||||||
import coverageType from '@/constants/coverage-type';
|
import coverageType from '@/constants/coverage-type';
|
||||||
import oemEndorsementModal from '@/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue';
|
import oemEndorsementModal from '@/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue';
|
||||||
|
|
@ -494,6 +495,7 @@ export default {
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
|
||||||
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
||||||
this.mainStore.updateIsSafeliteProvider(true);
|
this.mainStore.updateIsSafeliteProvider(true);
|
||||||
|
this.pushEventToGA('ShopSelection', 'Safelite', this.mainStore.currentDeductible + `_` + getPriceOfLineItems(getAvailableLineItems(this.mainStore.order)), true);
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE);
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE);
|
||||||
} else {
|
} else {
|
||||||
this.$router.navigateBailout(bailoutMessage.coverageStatementInvalidState());
|
this.$router.navigateBailout(bailoutMessage.coverageStatementInvalidState());
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
||||||
import bailoutMessage from '@/constants/bailoutMessage';
|
import bailoutMessage from '@/constants/bailoutMessage';
|
||||||
import baseFormMixin from '@/mixins/base-form-mixin';
|
import baseFormMixin from '@/mixins/base-form-mixin';
|
||||||
import PROVIDER_PREFERENCE_OPTIONS from '@/constants/provider-preference';
|
import PROVIDER_PREFERENCE_OPTIONS from '@/constants/provider-preference';
|
||||||
|
import { getPriceOfLineItems } from '@/helpers/price-calculator';
|
||||||
|
import { getAvailableLineItems } from '@/helpers/cart-helper';
|
||||||
|
|
||||||
// Import Component
|
// Import Component
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
|
|
@ -159,12 +161,14 @@ export default {
|
||||||
this.mainStore.updateIsSafeliteProvider(true);
|
this.mainStore.updateIsSafeliteProvider(true);
|
||||||
const scenario = this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE;
|
const scenario = this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE;
|
||||||
this.pushEventToGA('prefered_provider', 'Safelite', this.mainStore.accountNameForEvents, true);
|
this.pushEventToGA('prefered_provider', 'Safelite', this.mainStore.accountNameForEvents, true);
|
||||||
|
this.pushEventToGA('ShopSelection', 'Safelite', this.mainStore.currentDeductible + `_` + getPriceOfLineItems(getAvailableLineItems(this.mainStore.order)), true);
|
||||||
this.navigateForward(scenario);
|
this.navigateForward(scenario);
|
||||||
},
|
},
|
||||||
scheduleWithTPA() {
|
scheduleWithTPA() {
|
||||||
this.mainStore.updateIsSafeliteProvider(false);
|
this.mainStore.updateIsSafeliteProvider(false);
|
||||||
const scenario = this.navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED;
|
const scenario = this.navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED;
|
||||||
this.pushEventToGA('prefered_provider', 'TPA', this.mainStore.accountNameForEvents, true);
|
this.pushEventToGA('prefered_provider', 'TPA', this.mainStore.accountNameForEvents, true);
|
||||||
|
this.pushEventToGA('ShopSelection', 'Other', this.mainStore.currentDeductible + `_` + getPriceOfLineItems(getAvailableLineItems(this.mainStore.order)), true);
|
||||||
this.navigateForward(scenario);
|
this.navigateForward(scenario);
|
||||||
},
|
},
|
||||||
findAnotherShopClicked() {
|
findAnotherShopClicked() {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ import {
|
||||||
GaEvents,
|
GaEvents,
|
||||||
ValueToLogTypes
|
ValueToLogTypes
|
||||||
} from '@/constants/analytics';
|
} from '@/constants/analytics';
|
||||||
import { getCartTotal, getSubtotal } from '@/helpers/cart-helper';
|
import { getPriceOfLineItems } from '@/helpers/price-calculator';
|
||||||
|
import { getAvailableLineItems, getCartTotal, getSubtotal } from '@/helpers/cart-helper';
|
||||||
import { getRecalPartNumbers, isRecalOrder } from "@/helpers/recal-helper";
|
import { getRecalPartNumbers, isRecalOrder } from "@/helpers/recal-helper";
|
||||||
import coverageStatuses from '@/constants/coverage-statuses';
|
import coverageStatuses from '@/constants/coverage-statuses';
|
||||||
import coverageType from '@/constants/coverage-type';
|
import coverageType from '@/constants/coverage-type';
|
||||||
|
|
@ -273,7 +274,7 @@ export default {
|
||||||
payload.priceTotal = "";
|
payload.priceTotal = "";
|
||||||
// ITAC or NoComp (where cash price is shown)
|
// ITAC or NoComp (where cash price is shown)
|
||||||
} else if (store.isVerified && (store.isITAC || store.isNoComp)) {
|
} else if (store.isVerified && (store.isITAC || store.isNoComp)) {
|
||||||
const subtotal = getSubtotal(order).toFixed(2);
|
const subtotal = getPriceOfLineItems(getAvailableLineItems(order)).toFixed(2);
|
||||||
payload.priceSubTotal = parseFloat(subtotal);
|
payload.priceSubTotal = parseFloat(subtotal);
|
||||||
const total = getCartTotal(order).toFixed(2);
|
const total = getCartTotal(order).toFixed(2);
|
||||||
payload.priceTotal = parseFloat(total);
|
payload.priceTotal = parseFloat(total);
|
||||||
|
|
@ -283,7 +284,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cash Quote or Cash Price Sub Total
|
// Cash Quote or Cash Price Sub Total
|
||||||
payload.cashPriceSubTotal = getSubtotal(order).toString();
|
payload.cashPriceSubTotal = getPriceOfLineItems(getAvailableLineItems(order)).toString();
|
||||||
|
|
||||||
// Recalibration
|
// Recalibration
|
||||||
payload.isRecalibrationOnOrder = isRecalOrder(order.lineItems);
|
payload.isRecalibrationOnOrder = isRecalOrder(order.lineItems);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue