diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 3c0b31f2b..6df09f462 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -14,11 +14,14 @@
{{ packagePrice }}
-
+
{{ lineItem.name }} Remove
-
+
+
{{ lineItem.name }} Remove {{ lineItem.price }} @@ -56,8 +59,9 @@ export default { headerCmsWidgetName: String, servicePackageOptionsCmsName: String, damage: Object, - storeLineItems: Object, + orderLineItems: Object, availableLineItems: Object, + allowableCartItems: Object, }, data() { return { @@ -137,7 +141,6 @@ export default { (entry) => entry.Name === this.packageLevel ); - console.log("WidgetName", currentPackage); return currentPackage.SubWidgetName; }, packageLevel() { @@ -160,13 +163,14 @@ export default { displayedPackageLineItems() { const displayedPackageLineItems = []; const packageLineItems = this.getVapsLineItemsForSelectedPackage(this.packageLevel); - + //TO DO Could we get the same list from this.orderLineItems? packageLineItems?.forEach((item) => { let price = item.sellingPrice + item.kitPrice + item.laborAmount; const packageLineItem = { name: item.partType, price: "$" + parseFloat(price).toFixed(2), partType: item.partType, + isRemovable: item.isRemovable, }; displayedPackageLineItems.push(packageLineItem); }); @@ -175,17 +179,27 @@ export default { }, displayedNonPackageLineItems() { const displayedNonPackageLineItems = []; - - this.availableLineItems?.forEach((item) => { + const possibleLineItems = [ + ...this.orderLineItems.vaps, + ...this.orderLineItems.supportingItems, + ]; + possibleLineItems?.forEach((item) => { let price = item.sellingPrice + item.kitPrice + item.laborAmount; + const isAllowed = this.allowableLineItems?.findIndex((lineItem) => { + return lineItem.partType === item.partType; + }); const indexFound = this.displayedPackageLineItems?.findIndex((packageLineItem) => { return packageLineItem.partType === item.partType; }); - if (indexFound === -1) { + const isInPackage = this.displayedPackageLineItems?.findIndex((packageLineItem) => { + return packageLineItem.partType === item.partType; + }); + if (isInPackage === -1 && isAllowed > -1) { const nonPackageLineItem = { name: item.partType, price: "$" + parseFloat(price).toFixed(2), partType: item.partType, + isRemovable: item.isRemovable, }; displayedNonPackageLineItems.push(nonPackageLineItem); } @@ -199,7 +213,7 @@ export default { return this.damage.isRepair; }, vaps() { - return this.storeLineItems?.vaps; + return this.orderLineItems?.vaps; }, recycleLabel() { return "Recycling"; diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index e58d82175..750ae52cf 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -15,9 +15,10 @@
+ servicePackageOptionsCmsName="ServicePackageTitle" + :allowableCartItems="ALLOWABLE_CART_ITEMS" />