File

feature-libs/checkout/components/order-confirmation/components/order-confirmation-items/order-confirmation-items.component.ts

Implements

OnInit OnDestroy

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-order-confirmation-items
templateUrl ./order-confirmation-items.component.html

Index

Properties
Methods

Constructor

constructor(checkoutService: CheckoutFacade)
Parameters :
Name Type Optional
checkoutService CheckoutFacade No

Methods

ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

order$
Type : Observable<Order>
promotionLocation
Type : PromotionLocation
Default value : PromotionLocation.Checkout
import {
  ChangeDetectionStrategy,
  Component,
  OnDestroy,
  OnInit,
} from '@angular/core';
import { CheckoutFacade } from '@spartacus/checkout/root';
import { Order, PromotionLocation } from '@spartacus/core';
import { Observable } from 'rxjs';

@Component({
  selector: 'cx-order-confirmation-items',
  templateUrl: './order-confirmation-items.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrderConfirmationItemsComponent implements OnInit, OnDestroy {
  promotionLocation: PromotionLocation = PromotionLocation.Checkout;
  order$: Observable<Order>;

  constructor(protected checkoutService: CheckoutFacade) {}

  ngOnInit() {
    this.order$ = this.checkoutService.getOrderDetails();
  }

  ngOnDestroy() {
    this.checkoutService.clearCheckoutData();
  }
}
<div class="cx-order-items container" *ngIf="order$ | async as order">
  <h4 class="cx-order-items-header">
    {{ 'checkoutOrderConfirmation.orderItems' | cxTranslate }}
  </h4>

  <cx-promotions
    [promotions]="order.appliedOrderPromotions || []"
  ></cx-promotions>

  <cx-cart-item-list
    [items]="order.entries"
    [readonly]="true"
    [promotionLocation]="promotionLocation"
  ></cx-cart-item-list>
</div>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""