productcategory

package
v1.49.21 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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