Product

Product

A Product contains one or more ProductVariants and serves as a container for those variants, providing an overall name, description etc.

Signature

class Product extends VendureEntity implements Translatable, HasCustomFields, ChannelAware, SoftDeletable {
  constructor(input: DeepPartial<Product>)
  @Column({ type: Date, nullable: true, default: null })
    deletedAt: Date | null;
  name: LocaleString;
  slug: LocaleString;
  description: LocaleString;
  @ManyToOne(type => Asset)
    featuredAsset: Asset;
  @ManyToMany(type => Asset)
    @JoinTable()
    assets: Asset[];
  @OneToMany(type => ProductTranslation, translation => translation.base, { eager: true })
    translations: Array<Translation<Product>>;
  @OneToMany(type => ProductVariant, variant => variant.product)
    variants: ProductVariant[];
  @ManyToMany(type => ProductOptionGroup)
    @JoinTable()
    optionGroups: ProductOptionGroup[];
  @ManyToMany(type => FacetValue)
    @JoinTable()
    facetValues: FacetValue[];
  @Column(type => CustomProductFields)
    customFields: CustomProductFields;
  @ManyToMany(type => Channel)
    @JoinTable()
    channels: Channel[];
}

Members

constructor

method
type:
(input: DeepPartial<Product>) => Product

deletedAt

property
type:
Date | null

name

property
type:
LocaleString

slug

property
type:
LocaleString

description

property
type:
LocaleString

featuredAsset

property
type:
Asset

assets

property
type:
Asset[]

translations

property
type:
Array<Translation<Product>>

variants

property
type:
ProductVariant[]

optionGroups

property

facetValues

property
type:
FacetValue[]

customFields

property
type:
CustomProductFields

channels

property
type:
Channel[]
alpha