File

feature-libs/order/components/order-details/order-detail-items/order-consigned-entries/order-consigned-entries.component.ts

Metadata

selector cx-order-consigned-entries
templateUrl ./order-consigned-entries.component.html

Index

Properties
Methods
Inputs

Inputs

consignments
Type : Consignment[]
order
Type : Order

Methods

getConsignmentProducts
getConsignmentProducts(consignment: Consignment)
Parameters :
Name Type Optional
consignment Consignment No
Returns : OrderEntry[]

Properties

consignments
Type : Consignment[]
Decorators :
@Input()
order
Type : Order
Decorators :
@Input()
promotionLocation
Type : PromotionLocation
Default value : PromotionLocation.Order
import { Component, Input } from '@angular/core';
import {
  Consignment,
  Order,
  OrderEntry,
  PromotionLocation,
} from '@spartacus/core';

@Component({
  selector: 'cx-order-consigned-entries',
  templateUrl: './order-consigned-entries.component.html',
})
export class OrderConsignedEntriesComponent {
  @Input() consignments: Consignment[];
  @Input() order: Order;
  promotionLocation: PromotionLocation = PromotionLocation.Order;

  getConsignmentProducts(consignment: Consignment): OrderEntry[] {
    const products: OrderEntry[] = [];
    consignment.entries?.forEach((element) => {
      if (element.orderEntry) {
        products.push(element.orderEntry);
      }
    });

    return products;
  }
}
<div *ngFor="let consignment of consignments" class="cx-list row">
  <div class="cx-list-header col-12">
    <div class="cx-list-status">
      <span *ngIf="consignment">
        {{ 'orderDetails.deliveryStatus_' + consignment?.status | cxTranslate }}
      </span>
    </div>
    <div *ngIf="consignment?.statusDate" class="cx-list-date">
      <div>{{ consignment?.statusDate | cxDate }}</div>
    </div>

    <cx-consignment-tracking
      [orderCode]="order.code"
      [consignment]="consignment"
      *cxFeature="'consignmentTracking'"
    >
    </cx-consignment-tracking>
  </div>
  <div class="cx-list-item col-12">
    <cx-cart-item-list
      [items]="consignment.entries"
      [readonly]="true"
      [promotionLocation]="promotionLocation"
    ></cx-cart-item-list>
  </div>
</div>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""