SSR-1205 Fix Payment-Page Cart Item List
Fix feeItems list not updating
This commit is contained in:
parent
6957bcc951
commit
2a6e6bd82a
3 changed files with 11 additions and 18 deletions
|
|
@ -337,6 +337,12 @@ export default {
|
|||
rainDefenseCartItem() {
|
||||
return this.getCartItemForVapsPart(partTypeStrings.RAIN_DEFENSE);
|
||||
},
|
||||
allCartItems() {
|
||||
return [
|
||||
...this.servicePackageCartItems,
|
||||
...this.nonServicePackageCartItems
|
||||
];
|
||||
},
|
||||
packagePrice() {
|
||||
return this.servicePackageCartItems?.reduce(
|
||||
(accumulator, cartItem) => accumulator + (cartItem?.subTotal ?? 0),
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
class="px-2">
|
||||
<hr :class="{'my-0': isCreditCard}">
|
||||
<cartDropdown
|
||||
ref="cart"
|
||||
:readOnly="true"
|
||||
:showDropdownHeader="true"
|
||||
:isInitiallyExpanded="true"
|
||||
|
|
@ -459,13 +460,10 @@ export default {
|
|||
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
|
||||
vm.$nextTick(() => {
|
||||
if (vm.$refs.cart) {
|
||||
const { cartItems } = vm.$refs.cart;
|
||||
const cartItems = vm.$refs.cart.allCartItems;
|
||||
vm.getPayInAdvanceLineItems(cartItems);
|
||||
} else {
|
||||
vm.getMockPiaLineItems();
|
||||
}
|
||||
|
||||
vm.fetchSignatureInfo(resultMap.paymentSignature);
|
||||
|
|
@ -705,16 +703,6 @@ export default {
|
|||
getPayInAdvanceFormattedLineItem(itemName, price, quantity) {
|
||||
return `${itemName}|${price}|${quantity}`;
|
||||
},
|
||||
getMockPiaLineItems() {
|
||||
let lineItems = [];
|
||||
lineItems = [
|
||||
this.getPayInAdvanceFormattedLineItem('Parts and labor', 0, 1)
|
||||
];
|
||||
lineItems.push(this.getPayInAdvanceFormattedLineItem('New wiper blades', 75.22, 1));
|
||||
lineItems.push(this.getPayInAdvanceFormattedLineItem('Recycling', 37.6, 1));
|
||||
|
||||
this.payInAdvanceLineItems = lineItems.join('||');
|
||||
},
|
||||
getAmountDue() {
|
||||
return getCartTotal(useMainStore().order);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1661,6 +1661,7 @@ export const useMainStore = defineStore({
|
|||
if (feeItem) {
|
||||
feeItems.push(feeItem);
|
||||
}
|
||||
this.order.lineItems.feeItems = feeItems;
|
||||
},
|
||||
|
||||
async setPriceAndSalesTaxForOrderLineItems() {
|
||||
|
|
@ -2558,10 +2559,8 @@ function addPricesToLineItems(lineItems, pricingLineItems) {
|
|||
addPricesToLineItems(lineItem.childParts, pricingLineItems);
|
||||
}
|
||||
|
||||
const lineItemIndex = pricingLineItems.findIndex((pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber);
|
||||
|
||||
if (lineItemIndex > -1) {
|
||||
const pricedLineItem = pricingLineItems[lineItemIndex];
|
||||
const pricedLineItem = pricingLineItems.find((pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber);
|
||||
if (pricedLineItem) {
|
||||
lineItem.laborAmount = pricedLineItem.laborAmount;
|
||||
lineItem.sellingPrice = pricedLineItem.sellingPrice;
|
||||
lineItem.kitPrice = pricedLineItem.kitPrice;
|
||||
|
|
|
|||
Loading…
Reference in a new issue