# `PhoenixKit.Modules.Shop.Category`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L1)

Category schema for product organization.

Supports hierarchical nesting via parent_uuid.

## Fields

- `name` - Category name (required)
- `slug` - URL-friendly identifier (unique)
- `description` - Category description
- `featured_product_uuid` - Featured product for fallback image
- `parent_uuid` - Parent category for nesting
- `position` - Sort order
- `status` - Category status: "active", "hidden", "archived"
- `metadata` - JSONB for custom fields
- `option_schema` - Category-specific product option definitions (JSONB array)

## Status Values

- `active` - Category and products visible in storefront
- `unlisted` - Category hidden from menu, but products still visible
- `hidden` - Category and all products hidden from storefront

# `t`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L31)

```elixir
@type t() :: %PhoenixKit.Modules.Shop.Category{
  __meta__: term(),
  children: term(),
  description: term(),
  featured_product: term(),
  featured_product_uuid: term(),
  image_uuid: term(),
  inserted_at: term(),
  metadata: term(),
  name: term(),
  option_schema: term(),
  parent: term(),
  parent_uuid: term(),
  position: term(),
  products: term(),
  slug: term(),
  status: term(),
  updated_at: term(),
  uuid: term()
}
```

# `active?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L165)

Returns true if category is active (visible in storefront).

# `breadcrumb_path`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L210)

Returns the full path of category names from root to this category.
Requires parent to be preloaded.

## Parameters

  - `category` - Category struct with parent preloaded
  - `language` - Language code for localized names (default: system default)

## Examples

    iex> breadcrumb_path(category, "en")
    ["Home", "Electronics", "Phones"]

# `changeset`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L76)

Changeset for category creation and updates.

# `get_image_url`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L116)

Returns the image URL for a category.

Priority:
1. Storage media (image_uuid) if available
2. Featured product's featured_image_uuid (requires :featured_product preloaded)
3. Featured product's legacy featured_image URL (requires :featured_product preloaded)
4. nil if no image

## Options
- `:size` - Storage dimension to use (default: "large")

# `has_children?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L156)

Returns true if category has children.

# `hidden?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L177)

Returns true if category is hidden (category and products not visible).

# `localized_fields`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L102)

Returns the list of localized field names.

# `products_visible?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L184)

Returns true if products in this category should be visible in storefront.
Products are visible when category is active or unlisted.

# `root?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L150)

Returns true if category is a root category (no parent).

# `show_in_menu?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L193)

Returns true if category should appear in category menu/list.
Only active categories appear in the menu.

# `statuses`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L69)

Returns list of valid category statuses

# `unlisted?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/shop/schemas/category.ex#L171)

Returns true if category is unlisted (not in menu, but products visible).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
