Merged PR 2063: fix(domain-checkout): After refreshing cart availabilities always keep previo...

fix(domain-checkout): After refreshing cart availabilities always keep previous selected price from purchasing options modal

Ref: #5488
This commit is contained in:
Nino Righi
2025-12-02 11:59:35 +00:00
committed by Lorenz Hilpert
parent db4f30af86
commit 0670dbfdb1
3 changed files with 7 additions and 22 deletions

View File

@@ -1251,7 +1251,12 @@ export class DomainCheckoutService {
await this.updateItemInShoppingCart({
processId,
update: { availability },
update: {
availability: {
...availability,
price: item?.availability?.price ?? availability?.price,
}, // #5488 After Refreshing Availabilities in Cart make sure to keep the original selected price from purchasing options modal
},
shoppingCartItemId: item.id,
}).toPromise();

View File

@@ -132,7 +132,7 @@
}
}
<page-shopping-cart-item
(changeItem)="changeItem($event)"
(changeItem)="showPurchasingListModal([$event.shoppingCartItem])"
(changeDummyItem)="changeDummyItem($event)"
(changeQuantity)="updateItemQuantity($event)"
[quantityError]="

View File

@@ -388,26 +388,6 @@ export class CheckoutReviewComponent
this.openDummyModal({ data: shoppingCartItem, changeDataFromCart: true });
}
async changeItem({
shoppingCartItem,
}: {
shoppingCartItem: ShoppingCartItemDTO;
}) {
const shoppingCart = await firstValueFrom(this.shoppingCart$);
const modalRef = await this._purchaseOptionsModalService.open({
tabId: this.applicationService.activatedProcessId,
shoppingCartId: shoppingCart.id,
items: [shoppingCartItem],
type: 'update',
});
await firstValueFrom(modalRef.afterClosed$);
// Reload Shopping Cart after modal is closed to get updated items
this.#checkoutService.reloadShoppingCart({
processId: this.applicationService.activatedProcessId,
});
}
async openPrintModal() {
const shoppingCart = await this.shoppingCart$.pipe(first()).toPromise();
this.uiModal.open({