Skip to content

Commit

Permalink
fix: display addToQuote and addToOrderTemplate buttons on cart page e…
Browse files Browse the repository at this point in the history
…ven in case the cart contains quote items (#1054)
  • Loading branch information
SGrueber authored and shauke committed Mar 16, 2022
1 parent c9769c2 commit 1f0bb53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1 class="d-flex flex-wrap align-items-baseline">
<ish-line-item-list *ngIf="basket" [lineItems]="basket.lineItems"></ish-line-item-list>
</ng-template>

<div class="button-group" *ngIf="!basketContainsQuote">
<div class="button-group">
<ish-lazy-basket-add-to-quote></ish-lazy-basket-add-to-quote>
<ish-lazy-basket-create-order-template
*ngIf="basket"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';

import { BasketView } from 'ish-core/models/basket/basket.model';
import { HttpError } from 'ish-core/models/http-error/http-error.model';
Expand All @@ -25,20 +25,14 @@ import { HttpError } from 'ish-core/models/http-error/http-error.model';
templateUrl: './shopping-basket.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ShoppingBasketComponent implements OnChanges {
export class ShoppingBasketComponent {
@Input() basket: BasketView;
@Input() error: HttpError;

@Output() nextStep = new EventEmitter<void>();

submitted = false;

basketContainsQuote = false;

ngOnChanges() {
this.basketContainsQuote = this.basket.lineItems?.some(x => x.quote);
}

/**
* checkout button leads to checkout address page if basket is valid
*/
Expand Down

0 comments on commit 1f0bb53

Please sign in to comment.