Documentation
¶
Overview ¶
Package productcategory is the hierarchical product category tree (Medusa v2 parity: product-category). A category may nest under a parent; roots have an empty ParentId.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ProductCategory ¶
type ProductCategory struct {
mixin.Model[ProductCategory]
Name string `json:"name"`
Handle string `json:"handle"` // url slug
Description string `json:"description" datastore:",noindex"`
// ParentId is the parent category; empty = root.
ParentId string `json:"parentId,omitempty"`
Rank int `json:"rank"`
IsActive bool `json:"isActive" orm:"default:true"`
IsInternal bool `json:"isInternal"`
Metadata Map `json:"metadata,omitempty" datastore:"-"`
Metadata_ string `json:"-" datastore:",noindex"`
}
ProductCategory is one node in the category tree.
func New ¶
func New(db *datastore.Datastore) *ProductCategory
func (*ProductCategory) IsRoot ¶
func (c *ProductCategory) IsRoot() bool
IsRoot reports whether this category has no parent.
Click to show internal directories.
Click to hide internal directories.