ShippingLine

ShippingLine

A ShippingLine is created when a ShippingMethod is applied to an Order. It contains information about the price of the shipping method, any discounts that were applied, and the resulting tax on the shipping method.

Signature

class ShippingLine extends VendureEntity {
  constructor(input?: DeepPartial<ShippingLine>)
  @EntityId() @EntityId()
    shippingMethodId: ID | null;
  @Index() @ManyToOne(type => ShippingMethod) @Index()
    @ManyToOne(type => ShippingMethod)
    shippingMethod: ShippingMethod;
  @Index() @ManyToOne(type => Order, order => order.shippingLines, { onDelete: 'CASCADE' }) @Index()
    @ManyToOne(type => Order, order => order.shippingLines, { onDelete: 'CASCADE' })
    order: Order;
  @Money() @Money()
    listPrice: number;
  @Column() @Column()
    listPriceIncludesTax: boolean;
  @Column('simple-json') @Column('simple-json')
    adjustments: Adjustment[];
  @Column('simple-json') @Column('simple-json')
    taxLines: TaxLine[];
  @Calculated() price: number
  @Calculated() priceWithTax: number
  @Calculated() discountedPrice: number
  @Calculated() discountedPriceWithTax: number
  @Calculated() taxRate: number
  @Calculated() discounts: Discount[]
  addAdjustment(adjustment: Adjustment) => ;
  clearAdjustments() => ;
}

Extends

Members

constructor

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

shippingMethodId

property
type:
ID | null

shippingMethod

property

order

property
type:
Order

listPrice

property
type:
number

listPriceIncludesTax

property
type:
boolean

adjustments

property
type:
Adjustment[]

taxLines

property
type:
TaxLine[]

price

property
type:
number

priceWithTax

property
type:
number

discountedPrice

property
type:
number

discountedPriceWithTax

property
type:
number

taxRate

property
type:
number

discounts

property
type:
Discount[]

addAdjustment

method
type:
(adjustment: Adjustment) =>

clearAdjustments

method
type:
() =>