Price-Based Assortment
Automatic product assortment based on price availability
Price-based assortment automatically syncs product StoreIds, MarketIds, and MarketGroupIds based on the store and market assignments on the product's prices. This approach is ideal when product availability is determined by pricing agreements.
How It Works
Price Model
Prices contain store and market context that drives assortment:
| Property | Type | Description |
|---|---|---|
storeId | string | Specific store for this price |
storeGroupId | string | Group of stores |
marketId | string | Market for this price |
marketGroupId | string | Market group |
validFrom | DateTime | When price becomes active |
validUntil | DateTime? | When price expires |
Example Prices
Synchronization Logic
Omnium extracts store and market information from valid prices on products and their variants.
Validity Rules
A price is considered valid when:
validFromis null ORvalidFrom <= nowvalidUntilis null ORvalidUntil > now
Extraction Process
For each product:
- Iterate through all prices on the product
- For each currently valid price, collect the
storeIdandmarketId - Repeat for all variant prices
- Combine into distinct lists of store and market IDs
Store Category Exclusions
Even with price-based assortment, store category exclusions still apply:
- Extract storeIds from valid prices
- Check if product categories match any store's
AssortmentExcludeProductCategoryIds - Remove excluded stores from the final storeIds list
Enabling the Feature
1. Enable in Tenant Settings
2. Ensure Prices Have Store/Market Data
When creating or importing prices, include store and market information:
3. Run the Scheduled Task
Scheduled Task Name: Update assortment by prices
Scheduled Task Details
The scheduled task performs:
- Loads all stores (for category exclusion checking)
- Iterates through all products
- For each product:
- Extracts StoreIds from currently valid prices
- Extracts MarketIds from currently valid prices
- Derives MarketGroupIds from MarketIds
- Applies store category exclusions
- Updates product if any IDs changed
- Saves modified products in batches
Dynamic Availability
Price-based assortment enables dynamic product availability:
Scenario: Timed Launch
Product available in Norway starting February 1st:
Before Feb 1: Product not in oslo-store assortment After Feb 1: Product appears in oslo-store assortment
Scenario: Limited Time Sale
Price valid only during promotional period:
Product automatically leaves sale-store assortment when price expires.
Market Groups
MarketGroupIds are derived from MarketIds through tenant configuration:
When a product has prices for markets "no" and "se", its MarketGroupIds will include "nordic".
Variant Prices
Prices on variants are included in the calculation:
Result: Product gets StoreIds = ["store-a", "store-b"], MarketIds = ["no", "se"]
Price Filtering Priority
When displaying products, store-specific prices take priority:
- Store-specific price (highest priority)
- Market-level price (no storeId)
- Generic price (no storeId or marketId)
This ensures customers see the most relevant price for their context.
Best Practices
Price Data Quality
Ensure prices have complete store/market information:
- Always specify
storeIdfor store-specific pricing - Always specify
marketIdfor market-level pricing - Use
validFromandvalidUntilfor temporal pricing
Separate vs Embedded Prices
| Model | Best For |
|---|---|
| Embedded (on product) | Simple pricing, few price variants |
| Separate | Complex pricing, many stores/markets |
For price-based assortment with many stores, use separate prices (hasSeparatePrices: true).
Combining with Exclusions
Price-based assortment respects store category exclusions:
- Use exclusions for products that shouldn't appear in certain stores regardless of pricing
- Useful for compliance or channel restrictions
Comparison: Prices vs Categories
| Aspect | Price-Based | Category-Based |
|---|---|---|
| Configuration | Prices contain store/market | Stores contain categories |
| Trigger | Price changes | Category changes |
| Granularity | Per-product | Per-category |
| Best for | Price-driven availability | Category-driven assortment |
| Temporal control | Built-in (ValidFrom/ValidUntil) | Manual |
Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
| Product not in store | No valid price with that storeId | Add price with storeId and valid dates |
| Product appeared then disappeared | Price expired (ValidUntil passed) | Extend or create new price |
| Store excluded despite price | Category exclusion on store | Check store's assortmentExcludeProductCategoryIds |
| Variant not in assortment | Variant has no prices with storeId | Add prices to variant |
| MarketGroupId not set | MarketId not in any market group | Configure market groups in tenant settings |
