Documentation ¶
Overview ¶
Package catattr handles all product and category related attributes. The name catattr has been chosen to be unique so that one can use goimports without conflicts.
Package catattr handles all category and product related attributes. The name catattr has been chosen to be unique so that one can use goimports without conflicts.
Index ¶
- func HandlerCategory(i int64) *catHandler
- func HandlerProduct(i int64) *catHandler
- type AttributeSlice
- type Attributer
- type Catalog
- func (a *Catalog) ApplyTo() string
- func (a *Catalog) FrontendInputRenderer() eav.FrontendInputRendererIFace
- func (a *Catalog) IsComparable() bool
- func (a *Catalog) IsConfigurable() bool
- func (a *Catalog) IsFilterable() bool
- func (a *Catalog) IsFilterableInSearch() bool
- func (a *Catalog) IsGlobal() bool
- func (a *Catalog) IsHTMLAllowedOnFront() bool
- func (a *Catalog) IsSearchable() bool
- func (a *Catalog) IsUsedForPriceRules() bool
- func (a *Catalog) IsUsedForPromoRules() bool
- func (a *Catalog) IsVisible() bool
- func (a *Catalog) IsVisibleInAdvancedSearch() bool
- func (a *Catalog) IsVisibleOnFront() bool
- func (a *Catalog) IsWysiwygEnabled() bool
- func (a *Catalog) Position() int64
- func (a *Catalog) SearchWeight() int64
- func (a *Catalog) UsedForSortBy() bool
- func (a *Catalog) UsedInProductListing() bool
- type WSASlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerCategory ¶
func HandlerCategory(i int64) *catHandler
func HandlerProduct ¶
func HandlerProduct(i int64) *catHandler
Types ¶
type AttributeSlice ¶
type AttributeSlice []Attributer
AttributeSlice implements eav.AttributeSliceGetter @todo website must be present in the slice @todo must create interface to wrap custom columns
func (AttributeSlice) ByCode ¶
func (s AttributeSlice) ByCode(g eav.AttributeGetter, code string) (interface{}, error)
ByCode returns an catattr.Attributer by code. Use type assertion.
func (AttributeSlice) ByID ¶
func (s AttributeSlice) ByID(g eav.AttributeGetter, id int64) (interface{}, error)
ByID returns an catattr.Attributer by int64 id. Use type assertion.
func (AttributeSlice) Index ¶
func (s AttributeSlice) Index(i eav.AttributeIndex) interface{}
Index returns the current catattr.Attributer from index i. Use type assertion.
type Attributer ¶
type Attributer interface { eav.Attributer FrontendInputRenderer() eav.FrontendInputRendererIFace IsGlobal() bool IsVisible() bool IsSearchable() bool IsFilterable() bool IsComparable() bool IsVisibleOnFront() bool IsHTMLAllowedOnFront() bool IsUsedForPriceRules() bool IsFilterableInSearch() bool UsedInProductListing() bool UsedForSortBy() bool // IsConfigurable() bool not used anymore in Magento2 ApplyTo() string IsVisibleInAdvancedSearch() bool Position() int64 IsWysiwygEnabled() bool IsUsedForPromoRules() bool SearchWeight() int64 }
Attributer defines the minimal requirements for a catalog attribute. This interface consists of one more tables: catalog_eav_attribute. Developers can also extend this table to add more columns. These columns will be automatically transformed into more functions.
type Catalog ¶
Catalog a data container for attributes. You can use this struct to embed into your own struct for maybe overriding some method receivers.
func NewCatalog ¶
func NewCatalog( a *eav.Attribute, _ WSASlice, fir eav.FrontendInputRendererIFace, isGlobal bool, isVisible bool, isSearchable bool, isFilterable bool, isComparable bool, isVisibleOnFront bool, isHTMLAllowedOnFront bool, isUsedForPriceRules bool, isFilterableInSearch bool, usedInProductListing bool, usedForSortBy bool, isConfigurable bool, applyTo string, isVisibleInAdvancedSearch bool, position int64, isWysiwygEnabled bool, isUsedForPromoRules bool, searchWeight int64, ) *Catalog
NewCatalog creates a new Catalog attribute. Mainly used in code generation
func (*Catalog) FrontendInputRenderer ¶
func (a *Catalog) FrontendInputRenderer() eav.FrontendInputRendererIFace