productcategory

package
v1.46.21 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 5 Imported by: 0

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

func Query

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 (*ProductCategory) IsRoot

func (c *ProductCategory) IsRoot() bool

IsRoot reports whether this category has no parent.

func (*ProductCategory) Load

func (c *ProductCategory) Load(ps []datastore.Property) (err error)

func (*ProductCategory) Save

func (c *ProductCategory) Save() ([]datastore.Property, error)

Jump to

Keyboard shortcuts

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