parent_id to any category — making it a subcategory of another. Each category also has an is_active toggle that controls whether it appears on the storefront without requiring you to delete it.
Category fields
Each category record contains the following fields:| Field | Type | Description |
|---|---|---|
name | string | Display name of the category (minimum 2 characters) |
slug | string | URL-friendly identifier (e.g. "mens-clothing"); auto-generated from name if left blank |
description | string (optional) | Short description shown on the category page |
parent_id | string (optional) | ID of another category that acts as the parent; enables nested categories |
image_url | string (optional) | URL of an image representing the category |
is_active | boolean | Controls storefront visibility; true means the category is live |
display_order | number | Controls the sort order of categories in lists |
The
slug is automatically derived from the name when you create a category and leave the slug field blank. If you edit the slug manually, the auto-generation stops for that session so your custom value is preserved.Hierarchical categories with parent_id
Setting parent_id on a category makes it a child of another category. This lets you build multi-level category trees — for example:
- Electronics (top-level,
parent_idis empty)- Phones (
parent_id= Electronics) - Laptops (
parent_id= Electronics)
- Phones (
In the category table, the Parent Category column resolves the
parent_id to its display name automatically. If the parent category is deleted or unavailable, the column shows a dash.Creating a category
Open the Categories page
Navigate to Categories in the sidebar. Click New Category (or the equivalent create button) to open the category form.
Fill in the required fields
Enter a Name (required, minimum 2 characters) and a Slug (required, minimum 2 characters). The slug auto-populates as you type the name — you can leave it as-is or customize it.
Add optional details
Optionally add a Description, select a Parent Category from the dropdown to nest this category under another, and upload an Image to represent the category visually.
Set the active state
Use the Active toggle to control whether the category is visible on the storefront immediately. It defaults to active (
true).Editing a category
To edit an existing category, open the row actions menu (the ⋯ icon) next to the category in the table and select Edit. The same form used for creation opens pre-filled with the current values. Update any fields and save. Theslug field is editable — changing it will update the category’s URL path on the storefront.
Toggling a category’s active state
You can activate or deactivate a category without deleting it. In the row actions menu, select Activate or Deactivate depending on the current state. Theis_active field is updated immediately and the category table reflects the new status with a badge.
is_active value | Badge shown | Storefront visibility |
|---|---|---|
true | Active (green) | Visible |
false | Inactive (red) | Hidden |
Deleting a category
To permanently remove a category, open the row actions menu and select Delete. A confirmation dialog appears before the deletion is committed. Deleting a category does not automatically remove products assigned to it — products retain theircategory_ids references and must be updated separately if needed.