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 })
deletedAt: Date | null;
name: LocaleString;
slug: LocaleString;
description: LocaleString;
@Column({ default: true })
enabled: boolean;
@Index()
@ManyToOne(type => Asset, asset => asset.featuredInProducts, { onDelete: 'SET NULL' })
featuredAsset: Asset;
@OneToMany(type => ProductAsset, productAsset => productAsset.product)
assets: ProductAsset[];
@OneToMany(type => ProductTranslation, translation => translation.base, { eager: true })
translations: Array<Translation<Product>>;
@OneToMany(type => ProductVariant, variant => variant.product)
variants: ProductVariant[];
@OneToMany(type => ProductOptionGroup, optionGroup => optionGroup.product)
optionGroups: ProductOptionGroup[];
@ManyToMany(type => FacetValue, facetValue => facetValue.products)
@JoinTable()
facetValues: FacetValue[];
@ManyToMany(type => Channel, channel => channel.products)
@JoinTable()
channels: Channel[];
@Column(type => CustomProductFields)
customFields: CustomProductFields;
}
-
Extends:
VendureEntity
-
Implements:
Translatable
,HasCustomFields
,ChannelAware
,SoftDeletable
constructor
method
(input?: DeepPartial<Product>) => Product
deletedAt
property
Date | null
name
property
LocaleString
slug
property
LocaleString
description
property
LocaleString
enabled
property
boolean
featuredAsset
property
assets
property
ProductAsset[]
translations
property
Array<Translation<Product>>
variants
property
optionGroups
property
facetValues
property
channels
property
Channel[]
customFields
property
CustomProductFields