diff --git a/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue b/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue index 4240e3514..05ea8504b 100644 --- a/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue +++ b/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue @@ -44,13 +44,13 @@ export default { showAddRainDefense() { // if not found in the cart return !this.cartItems.some((vap) => { - return vap.partType === "RAIN DEFENSE"; + return vap?.partType === "RAIN DEFENSE"; }); }, showAddWipers() { // if not found in the cart return !this.cartItems.some((vap) => { - return vap.partType.includes(" WIPER"); + return vap?.partType?.includes(" WIPER"); }); }, rainDefensePrice() { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 9bdd66fca..45565d536 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -159,7 +159,10 @@ export default { const lineItems = store.getters.order.lineItems; - const combinedLineItems = [...glassParts, ...lineItems.supportingItems, ...lineItems.vaps]; + const combinedLineItems = []; + combinedLineItems.push(lineItems.glassParts ?? []); + combinedLineItems.push(lineItems.supportingItems ?? []); + combinedLineItems.push(lineItems.vaps ?? []); const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, @@ -175,11 +178,9 @@ export default { false ); - const cartItems = [...glassParts, ...lineItems.supportingItems, ...lineItems.vaps]; // TOBEREMOVED BY AJC IN CSR-1384 - // Call the "next" function to complete the transition to this page. next((vm) => { - vm.cartItems = cartItems; // TOBEREMOVED BY AJC IN CSR-1384 + vm.cartItems = combinedLineItems; // TOBEREMOVED BY AJC IN CSR-1384 vm.setCmsContent(resultMap.cmsContent); vm.availableLineItems = pricedAvailableLineItems;