product

package
v1.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package product represents abstraction of business layer product object

Index

Constants

View Source
const (
	ConstModelNameProduct           = "Product"
	ConstModelNameProductCollection = "ProductCollection"

	ConstErrorModule = "product"
	ConstErrorLevel  = env.ConstErrorLevelModel

	ConstOptionProductIDs = "_ids"
	ConstOptionImageName  = "image_name"
)

Package global constants

Variables

This section is empty.

Functions

func GetRegisteredStock

func GetRegisteredStock() stock.InterfaceStock

GetRegisteredStock returns currently used stack manager or nil

func RegisterStock

func RegisterStock(stock stock.InterfaceStock) error

RegisterStock registers given stock manager in system

func UnRegisterStock

func UnRegisterStock() error

UnRegisterStock removes stock management from system

Types

type InterfaceProduct

type InterfaceProduct interface {
	GetEnabled() bool

	GetSku() string
	GetName() string

	GetShortDescription() string
	GetDescription() string

	GetDefaultImage() string

	GetPrice() float64
	GetWeight() float64

	GetAppliedOptions() map[string]interface{}
	GetOptions() map[string]interface{}

	ApplyOptions(map[string]interface{}) error

	LoadExternalAttributes() error

	models.InterfaceModel
	models.InterfaceObject
	models.InterfaceStorable
	models.InterfaceMedia
	models.InterfaceListable
	models.InterfaceCustomAttributes
	models.InterfaceExternalAttributes
}

InterfaceProduct represents interface to access business layer implementation of product object

func GetProductModel

func GetProductModel() (InterfaceProduct, error)

GetProductModel retrieves current InterfaceProduct model implementation

func GetProductModelAndSetID

func GetProductModelAndSetID(productID string) (InterfaceProduct, error)

GetProductModelAndSetID retrieves current InterfaceProduct model implementation and sets its ID to some value

func LoadProductByID

func LoadProductByID(productID string) (InterfaceProduct, error)

LoadProductByID loads product data into current InterfaceProduct model implementation

type InterfaceProductCollection

type InterfaceProductCollection interface {
	ListProducts() []InterfaceProduct

	models.InterfaceCollection
}

InterfaceProductCollection represents interface to access business layer implementation of product collection

func GetProductCollectionModel

func GetProductCollectionModel() (InterfaceProductCollection, error)

GetProductCollectionModel retrieves current InterfaceProductCollection model implementation

Jump to

Keyboard shortcuts

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