Automatic Category Creation
Automatically create product categories from brand and season data using scheduled tasks in Omnium.
Omnium can automatically create and maintain product categories based on product data. This is useful for retailers with many brands or seasonal collections where manually creating categories would be impractical.
Overview
Two scheduled tasks handle automatic category creation:
| Scheduled Task | Source Property | Parent Category Setting |
|---|---|---|
CreateCategoriesFromSeasonScheduledTask | product.Season | seasonCategoryId |
CreateCategoriesFromBrandScheduledTask | product.Brand | brandCategoryId |
Both tasks follow the same pattern:
- Scan all active products
- Extract unique season/brand values
- Create categories for values that don't exist yet
- Assign the categories to the corresponding products
- Update modified products
Season Categories
Use Case
Season categories are ideal for:
- Fashion retailers with seasonal collections (Spring/Summer, Fall/Winter)
- Products with seasonal availability
- Time-based product organization
Configuration
-
Create the parent category for seasons:
-
Set the tenant configuration:
-
Ensure products have season data:
How It Works
When the CreateCategoriesFromSeasonScheduledTask runs:
- Loads existing categories under
seasonCategoryId - Iterates through all active products
- For each product with a
Seasonvalue:- Creates a new category if one doesn't exist for that season
- Adds the season category ID to the product's
categoryIds
- Saves all new categories and modified products
Example result:
Brand Categories
Use Case
Brand categories are ideal for:
- Multi-brand retailers
- Brand landing pages and navigation
- Brand-based filtering
Configuration
-
Create the parent category for brands:
-
Set the tenant configuration:
-
Ensure products have brand data:
How It Works
When the CreateCategoriesFromBrandScheduledTask runs:
- Loads existing categories under
brandCategoryId - Iterates through all active products
- For each product with a
Brandvalue:- Creates a new category if one doesn't exist for that brand
- Adds the brand category ID to the product's
categoryIds
- Saves all new categories and modified products
Example result:
Enabling Scheduled Tasks
Scheduled tasks are configured in tenant settings under Settings → Scheduled Tasks.
Task Configuration
The interval uses cron syntax. The examples above run:
- Season task: Daily at 2:00 AM
- Brand task: Daily at 3:00 AM
Recommended Schedule
| Scenario | Recommended Interval |
|---|---|
| Frequent product imports | Every 6 hours (0 0 */6 * * *) |
| Stable product catalog | Daily (0 0 2 * * *) |
| Manual/on-demand | Disabled (run via UI) |
Processing Details
Active Products Only
Both tasks only process products where isActive = true. Inactive products are skipped even if they have season/brand data.
Category Naming
Categories are created using the product property value as both the categoryId and name:
| Product Property | Created Category ID | Created Category Name |
|---|---|---|
season: "Spring 2024" | spring-2024 | Spring 2024 |
brand: "Acme Corp" | acme-corp | Acme Corp |
The category ID is typically normalized (lowercased, spaces replaced with hyphens).
Language Handling
Categories are created in the default product language. If multi-language support is needed, you'll need to manually create additional language versions of the automatically created categories.
Batch Processing
Products are processed in batches to handle large catalogs efficiently. Modified products are saved as each batch completes.
Combining with Other Features
With Parent Category Addition
When isProductCategoryParentsAdded is enabled, assigning a brand/season category also assigns the parent category:
Configuration:
Result: A product assigned to "Acme" brand category will have:
With Category Enrichment
When isProductCategoryEnriched is enabled, the product's productCategories array is populated:
Monitoring and Troubleshooting
Checking Task Status
View scheduled task history in Settings → Scheduled Tasks → History to see:
- Last run time
- Success/failure status
- Number of categories created
- Number of products updated
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Task reports "No season/brand category found" | Parent category setting is missing | Configure seasonCategoryId or brandCategoryId |
| Categories created but products not updated | Products are inactive | Activate products or check isActive status |
| Duplicate categories | Category ID normalization differences | Manually clean up duplicates |
| Missing categories for some products | Products don't have season/brand property set | Ensure product data includes the required property |
Manual Execution
Tasks can be run manually from the Omnium UI:
- Navigate to Settings → Scheduled Tasks
- Find the task (e.g.,
CreateCategoriesFromBrandScheduledTask) - Click Run Now
This is useful for:
- Initial setup after configuration
- Testing the configuration
- On-demand synchronization after bulk imports
