Merged PR 1264: #3145 Updated Order Checkout Process

#3145 Updated Order Checkout Process
This commit is contained in:
Nino Righi
2022-06-01 08:19:13 +00:00
committed by Lorenz Hilpert
parent 24a008b20d
commit 68d331864d
2 changed files with 11 additions and 2 deletions

View File

@@ -751,8 +751,8 @@ export class CheckoutReviewComponent extends ComponentStore<CheckoutReviewCompon
this.showOrderButtonSpinner = true;
await this.domainCheckoutService.completeCheckout({ processId }).toPromise();
this._orderCompleted.next();
this.patchProcess();
await this.router.navigate(['/kunde', this.applicationService.activatedProcessId, 'cart', 'summary']);
this.applicationService.removeProcess(this.applicationService.activatedProcessId);
} catch (error) {
const response = error?.error;
let message: string = response?.message ?? '';
@@ -771,8 +771,8 @@ export class CheckoutReviewComponent extends ComponentStore<CheckoutReviewCompon
if (error.status === 409) {
this._orderCompleted.next();
this.patchProcess();
await this.router.navigate(['/kunde', this.applicationService.activatedProcessId, 'cart', 'summary']);
this.applicationService.removeProcess(this.applicationService.activatedProcessId);
}
} finally {
this.showOrderButtonSpinner = false;
@@ -780,4 +780,10 @@ export class CheckoutReviewComponent extends ComponentStore<CheckoutReviewCompon
}
}
}
patchProcess() {
this.applicationService.patchProcess(this.applicationService.activatedProcessId, {
type: 'cart-checkout',
});
}
}

View File

@@ -12,6 +12,9 @@
<ui-icon icon="cart" size="18px"></ui-icon>
<span>{{ process?.data?.count || 0 }}</span>
</button>
<button *ngIf="process.type === 'cart-checkout'">
<span class="font-bold ml-2 text-lg">Bestellbestätigung</span>
</button>
</ng-container>
<button *ngIf="isActive && process.closeable" (click)="checkCloseProcess()" class="close">
<ui-icon icon="close" size="16px"></ui-icon>