CSR-1391 get lineitem names from cart

This commit is contained in:
Matt Caimi 2023-11-17 15:08:38 -05:00
parent e167bfd05e
commit d869962652

View file

@ -25,6 +25,7 @@
<hr />
<cart
ref="cart"
:damage="damageInfo"
:availableVaps="availableVaps"
:allowItemRemoval="false"
@ -227,7 +228,7 @@ export default {
invoiceNumber: this.getInvoiceNumber(),
totalAmount: this.getAmountDue(),
displayAmount: this.getDisplayAmountDue(),
piaLineItems: this.getPiaLineItems(),
piaLineItems: "",
paypalPayment: this.isPaypal(),
lineItems: [],
availableVaps: [],
@ -357,11 +358,18 @@ export default {
// Call the "next" function to complete the transition to this page.
next(async (vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.fetchSignatureInfo(resultMap.signature);
vm.setIFrameListener();
vm.availableVaps = taxedVaps;
vm.lineItems = lineItems;
vm.$nextTick(() => {
if (vm.$refs.cart) {
const cartItems = vm.$refs.cart.cartItems;
vm.getPiaLineItems(cartItems);
}
vm.fetchSignatureInfo(resultMap.signature);
vm.setIFrameListener();
});
});
},
computed: {
@ -506,7 +514,7 @@ export default {
return store.getters.payment.piaType;
}
},
getPiaLineItems() {
getPiaLineItems(cartItems) {
const itemMap = new Map();
const glassParts = store.getters.order.lineItems.glassParts;
const supportingItems = store.getters.order.lineItems.supportingItems;
@ -524,7 +532,7 @@ export default {
}
}
return Array.from(itemMap.values())
this.piaLineItems = Array.from(itemMap.values())
.map((item) => `${item.partType}|${item.amount}|${item.quantity}`)
.join("||");
},