Skip to content

Commit

Permalink
fix: in case of multiple buckets display message on checkout review page
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber authored and shauke committed May 4, 2021
1 parent 7fdd2fd commit eca7625
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ <h1 class="d-flex flex-wrap align-items-baseline">
<!-- Error Message-->
<div class="col-md-12">
<ish-error-message [error]="error" [toast]="false"></ish-error-message>
<div *ngIf="multipleBuckets" role="alert" class="alert alert-danger">
{{ 'checkout.shipping.no_methods.message' | translate }}
</div>
<ish-basket-validation-results></ish-basket-validation-results>
</div>

Expand Down Expand Up @@ -62,7 +65,7 @@ <h1 class="d-flex flex-wrap align-items-baseline">
editRouterLink="/checkout/shipping"
class="infobox-wrapper col-md-6"
>
<p>{{ basket.commonShippingMethod.name }}</p>
<p>{{ basket.commonShippingMethod?.name }}</p>
</ish-info-box>

<!-- Payment Method -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ export class CheckoutReviewComponent implements OnInit {

form: FormGroup;
submitted = false;
multipleBuckets = false;

ngOnInit() {
// create t&c form
this.form = new FormGroup({
termsAndConditions: new FormControl(false, Validators.pattern('true')),
});
this.multipleBuckets = !this.basket?.commonShippingMethod;
}

/**
Expand All @@ -39,6 +41,6 @@ export class CheckoutReviewComponent implements OnInit {
}

get formDisabled() {
return this.form.invalid && this.submitted;
return (this.form.invalid && this.submitted) || this.multipleBuckets;
}
}

0 comments on commit eca7625

Please sign in to comment.