diff --git a/src/fmg-components/cart/cart.spec.js b/src/fmg-components/cart/cart.spec.js index 10207c8bb..5adff3ab3 100644 --- a/src/fmg-components/cart/cart.spec.js +++ b/src/fmg-components/cart/cart.spec.js @@ -307,7 +307,7 @@ describe("cart.vue", () => { }); // Service package discount Fee Cart Item - test("if there is service package discount fee on the order, a service package discount cart item should be added to the cart", () => { + test("only if there is service package discount fee for the package, a service package discount cart item should be added to the cart", () => { // Arrange const lineItems = { glassParts: [], @@ -336,17 +336,8 @@ describe("cart.vue", () => { availableVaps: availableVaps, }, }); - // Assert - expect(wrapper.vm.servicePackageDiscountCartItem).not.toBeNull(); - expect(wrapper.vm.servicePackageDiscountCartItem.subTotal).toEqual(-70); - expect(wrapper.vm.servicePackageDiscountCartItem.salesTax).toEqual(0); - - const found = - wrapper.vm.cartItems.findIndex( - (cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem - ) >= 0; - expect(found).toBe(true); + expect(wrapper.vm.servicePackageDiscountCartItem).toBeNull(); }); // Other Supporting Items Cart Item diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index eebc23555..1130d3059 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -163,10 +163,15 @@ import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-moda // Mixins import baseMixin from "@/mixins/base-mixin.js"; +import experimentMixin from "@/mixins/experiment-mixin.js"; // Helpers import { deepClone } from "@/helpers/object-helper"; -import { getHighestFullySatisfiedTier, getPackageContents } from "@/helpers/service-package-helper"; +import { + getHighestFullySatisfiedTier, + getPackageContents, + getDiscountPackageName, +} from "@/helpers/service-package-helper"; import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper"; import { storeActions } from "@/constants/store-actions"; @@ -175,6 +180,7 @@ import { partTypeStrings } from "@/constants/part-type-strings"; import { cartItemCategories } from "@/constants/cart-item-categories"; import { cartItemTypes } from "@/constants/cart-item-types"; import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance"; +import { experimentSettings } from "@/constants/experiments"; export default { name: "cart", @@ -292,8 +298,16 @@ export default { this.lineItems[category] = this.lineItems[category].filter( (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType ); - - await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); + if (category == cartItemCategories.VAPS) { + await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); + } + if (category == cartItemCategories.SUPPORTING_ITEMS) { + await this.dispatchStoreAction( + storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, + this.lineItems.supportingItems, + false + ); + } }, async saveVaps(lineItems) { @@ -426,7 +440,14 @@ export default { } if (this.servicePackageDiscountCartItem) { - cartItems.push(this.servicePackageDiscountCartItem); + if (this.discountPackageNames != this.packageLevel) { + this.removeItem( + this.servicePackageDiscountCartItem.cartItemType, + cartItemCategories.SUPPORTING_ITEMS + ); + } else { + cartItems.push(this.servicePackageDiscountCartItem); + } } if (this.premiumAppointmentDiscountCartItem) { @@ -442,6 +463,12 @@ export default { return cartItems; }, }, + discountPackageNames() { + const discountServicePackage = experimentMixin.methods.getSettingValue( + experimentSettings.PROMO_ON_PACKAGE + ); + return getDiscountPackageName(discountServicePackage); + }, servicePackageTitleWidget() { const servicePackageNames = this.getCmsContent( this.servicePackageOptionsCmsName, diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index a0a61b7f4..5e71bb5b7 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -109,7 +109,7 @@ export async function getImplicitNavigation(toRoute) { Used to navigate to the heritage funnel with the correct query string and url. */ -export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog }) { +export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog, navType }) { const log = getQuerystringParameter(queryStrings.LOG); if (log === "true") { console.log("------------- Navigate to heritage start -----------------"); @@ -136,6 +136,10 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo heritageParms["promo"] = promo; } + if (navType) { + heritageParms["navType"] = navType; + } + if ( (process.env.VUE_APP_HERITAGE_FUNNEL.includes("fixmyglasstest") && process.env.VUE_APP_CURRENT_ENVIRONMENT === "Localhost") || diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 25826714c..5b8695d3e 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -428,7 +428,8 @@ export default { ); }, shouldHideRecalibration() { - return store.getters.shouldHideRecalibration; + if (this.isInsuranceSelected) return false; + return (experimentMixin.methods.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" && this.isRecalibrationOnOrder); }, showAfterpayBanner() { return ( diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue index af8c488f9..b147447f6 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue @@ -276,11 +276,16 @@ export default { max-height: 500px; } + .row { + align-items: center; + } + p { font-weight: 600; display: flex; justify-content: space-between; align-items: center; + white-space: nowrap; span { &.pricing-info { color: $green; @@ -315,11 +320,12 @@ export default { font-weight: 600; font-size: 0.875rem; display: flex; - justify-content: space-between; + justify-content: flex-end; + align-items: center; div.strikethrough-discount-price { text-decoration: line-through; margin-right: 0.5rem; - font-weight: 600; + font-weight: 400; font-size: 0.75rem; line-height: 20px; color: $gray-550; @@ -393,7 +399,7 @@ export default { display: flex; flex-direction: row; margin: auto; - margin-left: -2rem; + margin-left: -1.25rem; padding: 0.5rem 1rem; border-radius: 0.25rem; margin-top: 0.5rem; diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 93bdb6f27..9a6e649ec 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -520,7 +520,11 @@ export default { (payment?.insuranceCoverage?.isVerified || store.getters.order.referralNumber.length === 6) ) { - navigateToHeritageFunnel({ shouldSaveSession: false }); + navigateToHeritageFunnel({ + shouldSaveSession: false, + pageNameToLog: "service-location", + navType: "back", + }); } else { this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_BACK, diff --git a/src/store/index.js b/src/store/index.js index ca10f8f62..a5d1f4e68 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -939,7 +939,7 @@ export const getters = { .reduce((r, c) => Object.assign(r, c), {}) ?? {}, isVerifiedAndDeductibleZeroConfirmed: (state) => { - // used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages + // used in CMS on /payment-method in Header Sub Text, for FunnelSubHeaderWidget on cart pages if ( state.order.policy.currentDeductible === 0 && getters.coverageIsVerified(state) && @@ -949,6 +949,14 @@ export const getters = { } return false; }, + isItacOrNoComp: (state) => { + // used in CMS on /payment-method in Header Sub Text, for FunnelSubHeaderWidget on cart pages + if (state.order.policy.isNoComp || state.order.policy.isItac) { + return true; + } else { + return false; + } + }, requiresVerifiedRedirecting: (state) => { return state.order?.referralNumber?.length === 6; }, diff --git a/src/styles/common-styles.scss b/src/styles/common-styles.scss index 730712297..32b837dc3 100644 --- a/src/styles/common-styles.scss +++ b/src/styles/common-styles.scss @@ -10,7 +10,7 @@ body { overflow-x: unset; } &.page-container-grouped-styles { - height: 100vh; + height: 100dvh; display: flex; flex-direction: column; } @@ -68,6 +68,18 @@ body { height: 1px; overflow: hidden; } + + // Fix "iOS viewport scroll bug" issue on iPhone + // where bottom of page is covered by address bar + @media only screen + and (min-device-width: 375px) + and (max-device-width: 812px) + and (-webkit-min-device-pixel-ratio: 3) + and (orientation: portrait) { + .page-container-grouped-styles { + padding-bottom: 3rem; + } + } } .modal-open { .container-fluid {