Documentation

Product Categories

MANAGING PRODUCT CATEGORIES

Document Revision: v1.0

OVERVIEW

Categories organise products into a hierarchical tree in your catalog. Each
category has a name and optional description (one set per store language), an
optional parent category, filters, image, SEO keyword, sort order, status, store
visibility, and optional layout overrides. Categories can be nested (for example,
Electronics > Smartphones) using a parent/child relationship. Once created, a
category can be assigned to products in the Product form so customers can browse
by category on the storefront.


REQUIRED PERMISSION

The signed-in admin user must have modify permission on catalog/category.



ADD/CREATE NEW: STEP-BY-STEP

1. Go to Catalog > Categories.

2. Click the Insert button (top right).

3. On the General tab, for each enabled store language:
   a. Enter the Category Name (required, 2 to 255 characters).
   b. Optionally enter Meta Tag Description (recommended around 155
      characters including spaces).
   c. Optionally enter Meta Tag Keywords.
   d. Optionally enter a Description (rich-text editor).

4. Open the Data tab and complete the remaining fields:
   a. Parent: choose None for a top-level category, or select/type an existing
      category to create a nested (second-level or deeper) category.
      - If autocomplete is enabled (store setting), type the parent name and
        pick from suggestions; the hidden parent_id field is set automatically.
      - If autocomplete is disabled, use the Parent dropdown list.
   b. Filters: optionally assign product filters (checkbox list or
      autocomplete depending on store setting).
   c. Stores: check Default and/or any additional stores where this category
      should appear (Default is pre-selected for new categories).
   d. SEO Keyword: enter a URL-friendly keyword (no spaces; use hyphens).
      If Auto SEO URLs are enabled for Category in store settings, the keyword
      may be generated automatically as you type the name.
   e. Image: click Browse to open the File Manager and select an image
      (allowed formats: JPG, JPEG, PNG, GIF).
   f. Sort Order: enter a number to control list ordering (default: 0).
   g. Status: choose Enabled (default) or Disabled.

5. Optionally open the Design tab and choose a Layout Override per store
   (Default and any additional stores). Leave as None to use the default
   storefront layout.

6. Save the category using one of these buttons:
   - Save       Saves the category and returns to the category list.
   - Apply      Saves the category and re-opens the updated form to continue.
   - Cancel     Discards changes and returns to the list.


EXAMPLE 1: CREATE A SINGLE-LEVEL (TOP) CATEGORY — "Books"

Goal: add a top-level category with no parent, visible on the default store.

  General tab (English):
    Category Name:        Books
    Meta Tag Description: Browse our collection of books across all genres.
    Description:          (optional rich-text overview of the Books section)

  Data tab:
    Parent:       None  (parent_id = 0)
    Stores:       Default (checked)
    SEO Keyword:  books
    Image:        (optional — select via File Manager)
    Sort Order:   1
    Status:       Enabled

Steps:

  1. Catalog > Categories > Insert
  2. General tab > English: enter "Books" and optional SEO/description fields
  3. Data tab: leave Parent as None, set keyword "books", Sort Order = 1,
     Status = Enabled
  4. Click Save

Result: the list shows "Books" as a top-level category (name column displays
"Books" with no parent prefix). The category is available when assigning
products under Catalog > Products.


EXAMPLE 2: CREATE A NESTED SECOND-LEVEL CATEGORY — "Electronics" > "Smartphones"

Goal: create a parent category "Electronics", then a child category
"Smartphones" nested under it.

PART A — Create the parent category "Electronics"

  General tab (English):
    Category Name:  Electronics

  Data tab:
    Parent:       None
    SEO Keyword:  electronics
    Sort Order:   10
    Status:       Enabled

Steps:

  1. Catalog > Categories > Insert
  2. General tab: Category Name = Electronics
  3. Data tab: Parent = None, SEO Keyword = electronics, Sort Order = 10
  4. Click Save

PART B — Create the child category "Smartphones"

  General tab (English):
    Category Name:  Smartphones

  Data tab:
    Parent:       Electronics   (select from dropdown or autocomplete)
    SEO Keyword:  smartphones
    Sort Order:   1
    Status:       Enabled

Steps:

  1. Catalog > Categories > Insert
  2. General tab: Category Name = Smartphones
  3. Data tab: Parent = Electronics (the category created in Part A)
  4. Set SEO Keyword = smartphones, Sort Order = 1, Status = Enabled
  5. Click Save

Result: the list shows the child as "Electronics > Smartphones" in the Category
Name column. In the database, Smartphones has parent_id pointing to Electronics,
and category_path rows record the full hierarchy for efficient querying.

Note: create parent categories before their children. The Parent field only
lists categories that already exist.



EDIT: STEP-BY-STEP

1. Go to Catalog > Categories.

2. Locate the category (use the name filter if needed). Nested categories
   appear with their full path (e.g. "Electronics > Smartphones").

3. Click Edit in the Action column for that category.

4. Update fields on the General, Data, and/or Design tabs as needed:
   - Change names, descriptions, or meta tags for any language.
   - Change the Parent to move the category within the tree (a category
     cannot be set as its own parent).
   - Adjust filters, store visibility, SEO keyword, image, sort order, status,
     or layout overrides.

5. Click Save, Apply, or Cancel as when creating.


EXAMPLE: EDIT THE NESTED CATEGORY "Smartphones"

Goal: rename for SEO, change sort order, and move under a different parent
(optional).

  1. Catalog > Categories
  2. Filter or scroll to "Electronics > Smartphones" > Edit
  3. General tab (English):
       Category Name:        Mobile Phones
       Meta Tag Description: Shop the latest mobile phones and accessories.
  4. Data tab:
       Parent:       Electronics  (unchanged — or pick a different parent)
       SEO Keyword:  mobile-phones
       Sort Order:   5
       Status:       Enabled
  5. Click Save

Result: the list shows "Electronics > Mobile Phones" (path reflects the parent
and updated name). The SEO URL alias is updated. Child categories of
Smartphones/Mobile Phones, if any, retain their relationship under this node.



DELETE: STEP-BY-STEP

1. Go to Catalog > Categories.

2. Check the box(es) next to the category or categories to delete.
   (Use the header checkbox to select all categories on the current page.)

3. Click the Delete button.

4. Confirm the dialog when prompted ("Delete/Uninstall cannot be undone!
   Are you sure you want to do this?").

5. If deletion succeeds, a success message is shown and the list refreshes.

Important: deleting a parent category also deletes ALL nested child categories
recursively. Products are not deleted, but their links to removed categories
are cleared from product_to_category.


EXAMPLE 1: DELETE A SINGLE TOP-LEVEL CATEGORY

Goal: remove an unused test category "Books" that has no child categories.

  1. Catalog > Categories
  2. Optional: type "Books" in the filter and click Filter
  3. Check the box for "Books"
  4. Click Delete > Confirm

Result: the Books category and all related descriptions, filters, store links,
layout overrides, SEO aliases, and product-to-category links are removed.


EXAMPLE 2: DELETE A PARENT CATEGORY (INCLUDES CHILDREN)

Goal: remove "Electronics" which has a child "Electronics > Smartphones".

  1. Catalog > Categories
  2. Check the box for "Electronics" only (not the child row)
  3. Click Delete > Confirm

Result: both "Electronics" and "Electronics > Smartphones" (and any deeper
descendants) are removed from the database. Products previously assigned to
either category lose those category assignments but remain in the catalog.



USING CATEGORIES ON PRODUCTS

After a category exists:

  1. Open Catalog > Products and edit or create a product.
  2. On the product form, assign one or more categories (autocomplete is
     available).
  3. Save the product.

Categories with Status = Disabled may not appear on the storefront depending
on theme and catalog settings. Sort Order controls relative ordering among
sibling categories. Top-level categories (parent_id = 0) can optionally appear
in the main navigation when the Top setting is enabled (field present in the
form but hidden in the default template).



HIERARCHY (CLOSURE TABLE)

NivoCart stores category nesting in category_path using the MySQL Hierarchical
Data Closure Table pattern:

  - A top-level category (parent_id = 0) has one path row pointing to itself.
  - A child category inherits all path rows from its parent, then adds a row
    for itself at the next level.
  - The list page uses GROUP_CONCAT on path names to display "Parent > Child".
  - If paths become corrupted (e.g. after manual database edits), use the
    Repair button on the list page to run repairCategories(), which rebuilds
    paths starting from parent_id = 0.

 

Powered by NivoCart
NivoCart © 2013 - 2026