variant

package
v1.37.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Option

type Option struct {
	// Ex. Size
	Name string `json:"name"`
	// Ex. M
	Value string `json:"value"`
}

type Variant

type Variant struct {
	mixin.Model[Variant]
	mixin.Salesforce
	productcachedvalues.ProductCachedValues

	ProductId string `json:"productId"`

	SKU string `json:"sku"`
	UPC string `json:"upc,omitempty"`

	Name string `json:"name"`

	// Variant Media
	Header Media   `json:"header"`
	Image  Media   `json:"image"`
	Media  []Media `json:"media"`

	// Is the variant available
	Available bool `json:"available"`

	// Range in which variant is available. If active, it takes precedent over
	// Available bool.
	Availability Availability `json:"availability"`

	// Inventory int `json:"inventory"`
	Sold int `json:"sold"`

	Options []Option `json:"options"`
}

func Fake

func Fake(db *datastore.Datastore, productId string) *Variant

func New

func New(db *datastore.Datastore) *Variant

func (*Variant) Defaults

func (v *Variant) Defaults()

func (*Variant) Validator

func (v *Variant) Validator() *val.Validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL