Category Overview
Categories in OpenCart provide:- Hierarchical Structure - Create parent and child categories with unlimited nesting
- Multi-Language Support - Category names and descriptions in multiple languages
- SEO-Friendly URLs - Custom URLs for each category
- Category Images - Visual representation of categories
- Filters - Assign filters to help customers narrow down products
- Layouts - Custom page layouts per category
- Multi-Store - Assign categories to specific stores
Creating Categories
Required Category Information
Basic Category Structure
Category Descriptions
Categories support multi-language content:Category Description Structure
Category Description Structure
Hierarchical Categories
Creating Category Trees
Organize categories in parent-child relationships:Setting Parent Categories
The
path field in categories shows the full hierarchy (e.g., “Electronics > Computers > Laptops”). This is automatically maintained by OpenCart.Category Images
Setting Category Images
Category images are displayed on the category listing page and can be used in category layouts. Recommended size varies by theme but typically 256x256 pixels or larger.
Category Filters
Assign filters to categories to help customers narrow product selections:How Filters Work
How Filters Work
Filters allow customers to refine product searches within categories. For example:
- In the “Computers” category, show filters for:
- Processor Type (Intel, AMD)
- RAM Size (4GB, 8GB, 16GB)
- Screen Size (13”, 15”, 17”)
- Price Range
Store Assignment
Assign categories to specific stores:SEO Configuration
Creating SEO-Friendly URLs
URL Hierarchy
For nested categories, OpenCart builds hierarchical URLs:Only the last segment of the URL is stored in the database. The full path is generated automatically based on the category hierarchy.
Category Layouts
Assign custom layouts to categories:- Column structure (1, 2, or 3 columns)
- Module positions
- Widget placement
Category Filtering & Sorting
The category listing page supports various filters:Available Filters
filter_name- Search by category namefilter_store_id- Filter by storefilter_language_id- Filter by languagefilter_status- Show enabled/disabled categories
Sorting Options
- Sort by name (alphabetically)
- Sort by status (enabled first)
- Sort by sort_order (custom ordering)
Category Repair Function
OpenCart includes a repair function for category paths:When to Use Repair
- Categories show incorrect hierarchies
- Category paths are missing
- After manual database modifications
- After importing categories from external sources
Bulk Operations
Enable Categories
Activate multiple categories simultaneously
Disable Categories
Deactivate categories without deleting them
Delete Categories
Remove multiple categories at once
Repair Hierarchy
Fix category path and relationship issues
Deleting a category does not delete the products in that category. Products will simply no longer be associated with the deleted category.
Category Display Settings
Sort Order
Control the display order of categories:Status
Control category visibility:Best Practices
- Plan Your Hierarchy - Design category structure before creating categories
- Use Clear Names - Choose descriptive, customer-friendly category names
- Limit Depth - Avoid more than 3-4 levels of nesting for better UX
- Add Images - Use high-quality images for better visual appeal
- Optimize SEO - Create keyword-rich URLs and meta descriptions
- Assign Filters - Help customers find products easily
- Use Sort Order - Control category display order logically
- Check Paths - Verify category paths display correctly
- Multi-Language - Provide translations for all languages
- Regular Maintenance - Review and update category structure periodically
Category Navigation
Breadcrumbs
OpenCart automatically generates breadcrumb navigation:Category Menu
Categories appear in navigation menus based on:- Parent-child relationships
- Sort order
- Status (enabled/disabled)
Advanced Features
Category Filters Example
Complete Filter Configuration
Complete Filter Configuration
Technical Reference
Controller
Location:/upload/admin/controller/catalog/category.php
Key methods:
index()- Display category listingform()- Show add/edit category formsave()- Save category datadelete()- Delete categoriesenable()/disable()- Toggle category statusrepair()- Repair category hierarchyautocomplete()- AJAX category search
Model
Location:/upload/admin/model/catalog/category.php
Key methods:
addCategory()- Create new categoryeditCategory()- Update categorydeleteCategory()- Remove categorygetCategory()- Fetch category datagetCategories()- Get category list with filtersgetPaths()- Get category path hierarchygetPath()- Get category path stringrepairCategories()- Rebuild category structure
Database Tables
oc_category- Main category dataoc_category_description- Multi-language descriptionsoc_category_filter- Category filter assignmentsoc_category_to_store- Store assignmentsoc_category_to_layout- Layout assignmentsoc_category_path- Category hierarchy paths
Related Documentation
- Catalog Overview - Overall catalog management
- Product Management - Managing products in categories
- Orders - Processing orders

