ShippingMethod
ShippingMethod
A ShippingMethod is used to apply a shipping price to an Order. It is composed of a
ShippingEligibilityChecker and a ShippingCalculator. For a given Order,
the checker is used to determine whether this ShippingMethod can be used. If yes, then
the ShippingMethod can be applied and the calculator is used to determine the price of
shipping.
Signature
class ShippingMethod extends VendureEntity implements ChannelAware, SoftDeletable, HasCustomFields, Translatable {
constructor(input?: DeepPartial<ShippingMethod>)
@Column({ type: Date, nullable: true })
deletedAt: Date | null;
@Column() code: string;
name: LocaleString;
description: LocaleString;
@Column('simple-json') checker: ConfigurableOperation;
@Column('simple-json') calculator: ConfigurableOperation;
@Column()
fulfillmentHandlerCode: string;
@ManyToMany(type => Channel, channel => channel.shippingMethods)
@JoinTable()
channels: Channel[];
@OneToMany(type => ShippingMethodTranslation, translation => translation.base, { eager: true })
translations: Array<Translation<ShippingMethod>>;
@Column(type => CustomShippingMethodFields)
customFields: CustomShippingMethodFields;
apply(ctx: RequestContext, order: Order) => Promise<ShippingCalculationResult | undefined>;
test(ctx: RequestContext, order: Order) => Promise<boolean>;
}
-
Extends:
VendureEntity -
Implements:
ChannelAware,SoftDeletable,HasCustomFields,Translatable
constructor
method
(input?: DeepPartial<ShippingMethod>) => ShippingMethoddeletedAt
property
Date | nullcode
property
stringname
property
LocaleStringdescription
property
LocaleStringchecker
property
ConfigurableOperationcalculator
property
ConfigurableOperationfulfillmentHandlerCode
property
stringchannels
property
Channel[]translations
property
Array<Translation<ShippingMethod>>customFields
property
CustomShippingMethodFieldsapply
method
(ctx: RequestContext, order: Order) => Promise<ShippingCalculationResult | undefined>test
method
(ctx: RequestContext, order: Order) => Promise<boolean>