From 9c989055cbf22100e2efc9499394079c4ad29502 Mon Sep 17 00:00:00 2001 From: Lorenz Hilpert Date: Tue, 11 Nov 2025 09:09:28 +0000 Subject: [PATCH] Merged PR 2019: fix(customer-details): prioritize cart navigation over reward return URL fix(customer-details): prioritize cart navigation over reward return URL Fixes issue #5461 where navigating to cart after customer selection would incorrectly route to reward shop page. Changed navigation priority to check for regular shopping cart items before checking for reward return URL context. This ensures that active standard checkout flows take precedence over any lingering reward flow navigation context. Related work items: #5461 --- .../details-main-view.component.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/isa-app/src/page/customer/customer-search/details-main-view/details-main-view.component.ts b/apps/isa-app/src/page/customer/customer-search/details-main-view/details-main-view.component.ts index 2a24d8f89..3b0a30103 100644 --- a/apps/isa-app/src/page/customer/customer-search/details-main-view/details-main-view.component.ts +++ b/apps/isa-app/src/page/customer/customer-search/details-main-view/details-main-view.component.ts @@ -419,6 +419,15 @@ export class CustomerDetailsViewMainComponent await this._setShippingAddress(); + // #5461 Priority fix: Check for regular shopping cart items BEFORE reward return URL + // This ensures that if a user has items in their regular cart, that takes precedence + // over any lingering reward flow context + if (this.shoppingCartHasItems) { + await this.#rewardSelectionPopUpFlow(this.processId); + this.setIsBusy(false); + return; + } + // #5262 Check for reward selection flow before navigation if (this.hasReturnUrl()) { // Restore from preserved context (auto-scoped to current tab) and clean up @@ -437,16 +446,11 @@ export class CustomerDetailsViewMainComponent return; } - // Regular checkout navigation - if (this.shoppingCartHasItems) { - await this.#rewardSelectionPopUpFlow(this.processId); - } else { - // Navigation zur Artikelsuche - const path = this._catalogNavigation.getArticleSearchBasePath( - this.processId, - ).path; - await this._router.navigate(path); - } + // Navigation zur Artikelsuche + const path = this._catalogNavigation.getArticleSearchBasePath( + this.processId, + ).path; + await this._router.navigate(path); this.setIsBusy(false); }