Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IgnoreFieldMismatch = datastore.IgnoreFieldMismatch
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
mixin.Model
// Unique human readable identifier
Slug string `json:"slug"`
// Name of Collection
Name string `json:"name"`
// Description of collection
Description string `datastore:",noindex" json:"description"`
// Image/Video/Other Media to show in a gallery
Media []Media `json:"media"`
// Is the collection available
Available bool `json:"available"`
// Range in which collection is available. If active, it takes precedent
// over Available bool.
Availability struct {
Active bool `json:"active'"`
StartDate time.Time `json:"startDate"`
EndDate time.Time `json:"endDate"`
} `json:"availability"`
// Show this on store?
Published bool `json:"published"`
// Is this a preorder?
Preorder bool `json:"preorder"`
// Is this in stock?
OutOfStock bool `json:"outOfStock"`
// Lists of products or specific product variants that are part of this collection
ProductIds []string `json:"productIds"`
VariantIds []string `json:"variantIds"`
History []Event `json:"-"`
}
A collection of Products/Variants to be listed on a store
func New ¶
func New(db *datastore.Datastore) *Collection
func (*Collection) Defaults ¶
func (c *Collection) Defaults()
func (Collection) DisplayTitle ¶
func (c Collection) DisplayTitle() string
func (Collection) GetDescriptionParagraphs ¶
func (c Collection) GetDescriptionParagraphs() []string
func (*Collection) Init ¶
func (c *Collection) Init(db *datastore.Datastore)
func (Collection) Kind ¶
func (c Collection) Kind() string
func (*Collection) Validator ¶
func (c *Collection) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.