🚨 Announcing Vendure v2 Beta

OrderLine

OrderLine

A single line on an Order which contains one or more OrderItems.

Signature

class OrderLine extends VendureEntity implements HasCustomFields {
  constructor(input?: DeepPartial<OrderLine>)
  @ManyToOne(type => ProductVariant)
    productVariant: ProductVariant;
  @ManyToOne(type => TaxCategory)
    taxCategory: TaxCategory;
  @ManyToOne(type => Asset)
    featuredAsset: Asset;
  @OneToMany(type => OrderItem, item => item.line, { eager: true })
    items: OrderItem[];
  @ManyToOne(type => Order, order => order.lines, { onDelete: 'CASCADE' })
    order: Order;
  @Column(type => CustomOrderLineFields)
    customFields: CustomOrderLineFields;
  unitPrice: number
  unitPriceWithTax: number
  unitPriceChangeSinceAdded: number
  unitPriceWithTaxChangeSinceAdded: number
  discountedUnitPrice: number
  discountedUnitPriceWithTax: number
  proratedUnitPrice: number
  proratedUnitPriceWithTax: number
  quantity: number
  adjustments: Adjustment[]
  taxLines: TaxLine[]
  taxRate: number
  linePrice: number
  linePriceWithTax: number
  discountedLinePrice: number
  discountedLinePriceWithTax: number
  discounts: Discount[]
  lineTax: number
  proratedLinePrice: number
  proratedLinePriceWithTax: number
  proratedLineTax: number
  activeItems: OrderItem[]
  firstItem: OrderItem | undefined
  clearAdjustments(type?: AdjustmentType) => ;
}

Extends

Implements

  • HasCustomFields

Members

constructor

method
type:
(input?: DeepPartial<OrderLine>) => OrderLine

productVariant

property

taxCategory

property
type:
TaxCategory

featuredAsset

property
type:
Asset

items

property
type:
OrderItem[]

order

property
type:
Order

customFields

property
type:
CustomOrderLineFields

unitPrice

property
type:
number
The price of a single unit, excluding tax and discounts.

unitPriceWithTax

property
type:
number
The price of a single unit, including tax but excluding discounts.

unitPriceChangeSinceAdded

property
type:
number
Non-zero if the unitPrice has changed since it was initially added to Order.

unitPriceWithTaxChangeSinceAdded

property
type:
number
Non-zero if the unitPriceWithTax has changed since it was initially added to Order.

discountedUnitPrice

property
type:
number

The price of a single unit including discounts, excluding tax.

If Order-level discounts have been applied, this will not be the actual taxable unit price (see proratedUnitPrice), but is generally the correct price to display to customers to avoid confusion about the internal handling of distributed Order-level discounts.

discountedUnitPriceWithTax

property
type:
number
The price of a single unit including discounts and tax

proratedUnitPrice

property
type:
number
The actual unit price, taking into account both item discounts and prorated (proportionally-distributed) Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax and refund calculations.

proratedUnitPriceWithTax

property
type:
number
The proratedUnitPrice including tax.

quantity

property
type:
number

adjustments

property
type:
Adjustment[]

taxLines

property
type:
TaxLine[]

taxRate

property
type:
number

linePrice

property
type:
number
The total price of the line excluding tax and discounts.

linePriceWithTax

property
type:
number
The total price of the line including tax but excluding discounts.

discountedLinePrice

property
type:
number
The price of the line including discounts, excluding tax.

discountedLinePriceWithTax

property
type:
number
The price of the line including discounts and tax.

discounts

property
type:
Discount[]

lineTax

property
type:
number
The total tax on this line.

proratedLinePrice

property
type:
number
The actual line price, taking into account both item discounts and prorated (proportionally-distributed) Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax and refund calculations.

proratedLinePriceWithTax

property
type:
number
The proratedLinePrice including tax.

proratedLineTax

property
type:
number

activeItems

property
type:
OrderItem[]

firstItem

property
type:
OrderItem | undefined

clearAdjustments

method
type:
(type?: AdjustmentType) =>