catattr

package
v0.0.0-...-202847b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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

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.

func (AttributeSlice) Len

func (s AttributeSlice) Len() int

Len returns the length of a slice

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

type Catalog struct {
	*eav.Attribute
	// contains filtered or unexported fields
}

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) ApplyTo

func (a *Catalog) ApplyTo() string

func (*Catalog) FrontendInputRenderer

func (a *Catalog) FrontendInputRenderer() eav.FrontendInputRendererIFace

func (*Catalog) IsComparable

func (a *Catalog) IsComparable() bool

func (*Catalog) IsConfigurable

func (a *Catalog) IsConfigurable() bool

func (*Catalog) IsFilterable

func (a *Catalog) IsFilterable() bool

func (*Catalog) IsFilterableInSearch

func (a *Catalog) IsFilterableInSearch() bool

func (*Catalog) IsGlobal

func (a *Catalog) IsGlobal() bool

func (*Catalog) IsHTMLAllowedOnFront

func (a *Catalog) IsHTMLAllowedOnFront() bool

func (*Catalog) IsSearchable

func (a *Catalog) IsSearchable() bool

func (*Catalog) IsUsedForPriceRules

func (a *Catalog) IsUsedForPriceRules() bool

func (*Catalog) IsUsedForPromoRules

func (a *Catalog) IsUsedForPromoRules() bool

func (*Catalog) IsVisible

func (a *Catalog) IsVisible() bool

func (*Catalog) IsVisibleInAdvancedSearch

func (a *Catalog) IsVisibleInAdvancedSearch() bool

func (*Catalog) IsVisibleOnFront

func (a *Catalog) IsVisibleOnFront() bool

func (*Catalog) IsWysiwygEnabled

func (a *Catalog) IsWysiwygEnabled() bool

func (*Catalog) Position

func (a *Catalog) Position() int64

func (*Catalog) SearchWeight

func (a *Catalog) SearchWeight() int64

func (*Catalog) UsedForSortBy

func (a *Catalog) UsedForSortBy() bool

func (*Catalog) UsedInProductListing

func (a *Catalog) UsedInProductListing() bool

type WSASlice

type WSASlice []*Catalog

Jump to

Keyboard shortcuts

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