Merged PR 1595: #4189 Dont Display Customer Name if Shipping Address is Available

#4189 Dont Display Customer Name if Shipping Address is Available
This commit is contained in:
Nino Righi
2023-07-14 15:17:51 +00:00
committed by Lorenz Hilpert
parent 4bd4158dab
commit 4c641adeda
3 changed files with 11 additions and 5 deletions

View File

@@ -53,6 +53,11 @@ export class CheckoutReviewStore extends ComponentStore<CheckoutReviewState> {
switchMap((processId) => this._domainCheckoutService.getPayer({ processId }))
);
buyer$ = this._application.activatedProcessId$.pipe(
takeUntil(this.orderCompleted),
switchMap((processId) => this._domainCheckoutService.getBuyer({ processId }))
);
showBillingAddress$ = this.shoppingCartItems$.pipe(
withLatestFrom(this.customerFeatures$),
map(

View File

@@ -2,16 +2,16 @@
Überprüfen Sie die Details.
</h1>
<ng-container *ngIf="payer$ | async; let payer">
<div class="flex flex-row items-start justify-between p-5">
<ng-container *ngIf="buyer$ | async; let buyer">
<div *ngIf="!(showAddresses$ | async)" class="flex flex-row items-start justify-between p-5">
<div class="flex flex-row flex-wrap pr-4">
<ng-container *ngIf="!!payer?.lastName && !!payer?.firstName; else organisation">
<ng-container *ngIf="!!buyer?.lastName && !!buyer?.firstName; else organisation">
<div class="mr-3">Nachname, Vorname</div>
<div class="font-bold">{{ payer?.lastName }}, {{ payer?.firstName }}</div>
<div class="font-bold">{{ buyer?.lastName }}, {{ buyer?.firstName }}</div>
</ng-container>
<ng-template #organisation>
<div class="mr-3">Firmenname</div>
<div class="font-bold">{{ payer?.organisation?.name }}</div>
<div class="font-bold">{{ buyer?.organisation?.name }}</div>
</ng-template>
</div>

View File

@@ -21,6 +21,7 @@ export class CheckoutReviewDetailsComponent implements OnInit {
customerFeatures$ = this._store.customerFeatures$;
payer$ = this._store.payer$;
buyer$ = this._store.buyer$;
showAddresses$ = this._store.shoppingCartItems$.pipe(
takeUntil(this._store.orderCompleted),