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
This commit is contained in:
Lorenz Hilpert
2025-11-11 09:09:28 +00:00
committed by Nino Righi
parent 2e0853c91a
commit 9c989055cb

View File

@@ -419,6 +419,15 @@ export class CustomerDetailsViewMainComponent
await this._setShippingAddress(); 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 // #5262 Check for reward selection flow before navigation
if (this.hasReturnUrl()) { if (this.hasReturnUrl()) {
// Restore from preserved context (auto-scoped to current tab) and clean up // Restore from preserved context (auto-scoped to current tab) and clean up
@@ -437,16 +446,11 @@ export class CustomerDetailsViewMainComponent
return; return;
} }
// Regular checkout navigation // Navigation zur Artikelsuche
if (this.shoppingCartHasItems) { const path = this._catalogNavigation.getArticleSearchBasePath(
await this.#rewardSelectionPopUpFlow(this.processId); this.processId,
} else { ).path;
// Navigation zur Artikelsuche await this._router.navigate(path);
const path = this._catalogNavigation.getArticleSearchBasePath(
this.processId,
).path;
await this._router.navigate(path);
}
this.setIsBusy(false); this.setIsBusy(false);
} }