Product variants represent different versions of a product with unique attributes like size, color, price, and stock levels.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aluxey/E-Commerce/llms.txt
Use this file to discover all available pages before exploring further.
Variant Structure
Each variant contains:item_id- Parent product referencesize- Size identifier (e.g., “S”, “M”, “L”, “38cm”)price- Variant-specific price (decimal)stock- Available inventory count (integer)sku- Stock Keeping Unit identifier
item_variants
Creating Variants
Variants can be created in two ways:1. Quick Generation (Recommended)
Select Sizes
Click preset size chips to select multiple sizesPreset sizes: XS, S, M, L, XL, XXLLocated:
VariantsStep.jsx:41Set Base Price
Enter the price to apply to all generated variantsField:
basePrice (supports decimals)2. Manual Creation
Click “Add Manually” to create individual variants with custom sizes. Use Cases:- Non-standard sizes
- Product-specific measurements
- Custom variant attributes
Variant Editor
Each variant displays as a card with fields:Size Field
Price Field
Stock Field
SKU Display
SKUs are auto-generated during product save:SKUs are automatically generated when creating new variants. Existing SKUs are preserved when editing.
Variant Management Page
Access standalone variant management at/admin/variants
Features
Search: Filter by size, SKU, or product name Product Filter: Dropdown to filter variants by product Variant Cards Display:- Product name
- Size
- Price (formatted with 2 decimals)
- Stock count (with out-of-stock indicator)
- SKU code
Creating Standalone Variants
Editing Variants
Click the pencil icon to edit existing variants. Editable Fields:- Size
- Price
- Stock quantity
Deleting Variants
Click trash icon → Confirm deletion Implementation:VariantManager.jsx:117
Price Calculation
The parent product’s display price is the minimum of all variant prices:Stock Indicators
Variants with zero stock display an out-of-stock class:Form Validation
Variant validation checks:- Required fields:
item_id,size,price - Price validation: Must be numeric and non-negative
- Stock validation: Must be non-negative integer
- Code format: SKU must match pattern
[a-z0-9_-]+
VariantManager.jsx:59