File
Metadata
| selector |
cx-order-consigned-entries |
| templateUrl |
./order-consigned-entries.component.html |
Index
Properties
|
|
|
Methods
|
|
|
Inputs
|
|
|
|
consignments
|
Type : Consignment[]
|
|
|
Methods
|
getConsignmentProducts
|
getConsignmentProducts(consignment: Consignment)
|
|
|
|
Returns : OrderEntry[]
|
|
consignments
|
Type : Consignment[]
|
Decorators :
@Input()
|
|
|
|
order
|
Type : Order
|
Decorators :
@Input()
|
|
|
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 with directive