Dynamic Categories
Create categories that automatically display products based on saved search criteria using the savedSearchId feature.
Dynamic categories allow you to create category pages that automatically display products matching saved search criteria, without manually assigning products to the category.
What Are Dynamic Categories?
A dynamic category is a category linked to a saved search. Instead of displaying products that have the category assigned to them, it displays products that match the saved search criteria.
This enables:
- Automatic product collections (no manual assignment needed)
- Real-time product lists that update as products change
- Complex filtering criteria without product modifications
How It Works
The savedSearchId Property
Categories have a savedSearchId property that links them to a saved product search:
When savedSearchId is set:
- The category acts as a "virtual" category
- Products displayed come from the saved search, not from category assignments
- Product counts reflect the saved search results
Saved Search
A saved search stores product search criteria:
Use Cases
New Arrivals
Display products created recently without manually tagging them:
Saved Search:
Category:
On Sale
Display products with active promotions or discounted prices:
Saved Search:
Category:
Best Sellers
Display top-selling products based on sales data:
Saved Search:
Category:
Brand Collections
Display all products from a specific brand:
Saved Search:
Category:
Setting Up Dynamic Categories
Step 1: Create the Saved Search
Create a saved search with your desired criteria via the Omnium UI or API:
Note the returned id for the saved search.
Step 2: Create or Update the Category
Create a category with the savedSearchId property:
Step 3: Verify
The category now displays products from the saved search. Test by:
- Viewing the category in the Omnium UI
- Fetching products via the category tree API
- Verifying product counts match expectations
Important Considerations
No Manual Assignment
Products in dynamic categories are not assigned to the category:
- Products don't have the category in their
categoryIds - The relationship is defined by the search criteria only
- Changing the saved search immediately changes which products appear
Category Tree Behavior
Dynamic categories appear in the category tree with product counts based on the saved search:
Parent Category Addition
When isProductCategoryParentsAdded is enabled, products in dynamic categories do not automatically get the dynamic category or its parents added to their categoryIds. The relationship remains virtual.
Combining Static and Dynamic
A category can have either:
- Manually assigned products (no
savedSearchId) - Dynamic products from a saved search (
savedSearchIdset)
You cannot combine both. If savedSearchId is set, manual assignments are ignored for display purposes.
Performance
Dynamic categories execute the saved search query each time products are requested. For frequently accessed categories:
- Keep saved search criteria efficient
- Consider caching if available
- Monitor query performance
Limitations
| Limitation | Description |
|---|---|
| Single source | Categories display either static assignments OR saved search results, not both |
| No enrichment | Products don't have the dynamic category in their productCategories |
| Search limitations | Limited to what can be expressed in a saved search |
| Real-time only | Historical category membership is not tracked |
Removing Dynamic Behavior
To convert a dynamic category back to a static category:
After removing savedSearchId, products will need to be manually assigned to the category to appear.
