Variants and Attributes
Learn how to set up product variants using attributes like size, color, and other options. This allows customers to select exactly what they want from a single product page.
Understanding Variants and Attributes
Attributes are the characteristics that differentiate your products (e.g., Size, Color, Material).
Attribute Values are the specific options within an attribute (e.g., Small, Medium, Large for Size).
Variants are the specific combinations of attribute values that customers can purchase. Each variant has its own SKU, price, and inventory count.
Example
A t-shirt might have:
- Attribute: Size with values Small, Medium, Large
- Attribute: Color with values Black, White, Navy
This creates 9 variants: Small/Black, Small/White, Small/Navy, Medium/Black, and so on.
Attribute Types
Mozhe supports three attribute types:
Color Attributes
Color attributes are special because they display as visual swatches on your storefront:
- When creating a color attribute value, enter a Color Hex code (e.g.,
#FF0000for red) - Multi-color options are supported by entering comma-separated hex values (e.g.,
#FF0000,#0000FFfor red and blue) - The color swatch appears next to the color name in your storefront
Creating Attributes
Attributes are site-wide, meaning once created, they can be reused across multiple products.
To create a new attribute:
- Navigate to Products > Attributes in the sidebar
- Click Add Attribute
- Enter the attribute details:
Adding Attribute Values
After creating an attribute, add its possible values:
- Open the attribute you just created
- In the Values section, click Add Value
- Enter the value name (e.g., "Small")
- For Color attributes, enter the hex color code
- Repeat for all values
- Click Save
Tip: You can reorder attribute values by dragging them. The order here determines the display order on your storefront.
Assigning Attributes to Products
To add variants to a product:
- Open the product you want to edit
- Scroll to the Attributes section
- Click Add Attribute
- Select the attributes this product uses (e.g., Size, Color)
- The Variants section will update to show combinations
Managing Variant Combinations
Once attributes are assigned, you'll see all possible variant combinations:
- Each row represents one variant (one specific combination of attribute values)
- Fill in the details for each variant:
- SKU - Stock keeping unit (optional but recommended for inventory tracking)
- - The price for this variant
Example: Adding Size and Color
- Add the "Size" attribute to your product
- Add the "Color" attribute to your product
- You'll see variants like:
- Small / Black
- Small / White
- Medium / Black
- Medium / White
- Large / Black
- Large / White
- Set individual prices and stock for each combination
Variant-Specific Pricing
Each variant can have its own price. This is useful when:
- Larger sizes cost more to produce
- Premium colors use more expensive materials
- Certain combinations include additional features
Simply enter different prices in each variant row.
Variant-Specific Images
You can assign images to specific attribute values so customers see relevant photos when selecting options:
- Upload images to your product
- In the Media section, assign each image to attribute value combinations
- Use the General category for images that apply to all variants
- When customers select a color, they'll see images tagged with that color
Image Assignment Example
For a t-shirt with Red, Blue, and Green colors:
- Upload photos of each color
- Tag red shirt photos with the "Red" color value
- Tag blue shirt photos with the "Blue" color value
- Tag general lifestyle photos as "General"
When a customer clicks "Red," they'll see the red shirt photos first.
Inventory Per Variant
Stock is tracked separately for each variant:
- Each variant row shows its current stock level
- When orders come in, stock decreases for the specific variant purchased
- Variants with zero stock can be:
- Hidden automatically (configurable in shop settings)
- Shown as "Out of Stock"
- Still purchasable (for backorders)
See Inventory Management for detailed stock tracking options.
Variant Positions
Control the order variants appear on your storefront:
- Open your product
- In the Variants section, find the position handles
- Drag variants to reorder them
- The first variant becomes the default selection for customers
Creating Attributes Inline
If you need a new attribute while editing a product:
- In the Attributes dropdown, type a new attribute name
- Click Create "[name]"
- The attribute is created with default settings (type: Select, scope: Global)
- You can customize it later in Products > Attributes
Best Practices
Naming Conventions
- Use clear, customer-friendly names: "Size" not "SZ"
- Be consistent across products: always "Color" not sometimes "Colour"
- Use the same values: "Small" everywhere, not "S" on some products
When to Use Variants vs. Separate Products
Use variants when:
- The items are essentially the same product with minor differences
- Customers expect to choose options on one page
- Examples: shirt sizes, phone case colors
Use separate products when:
- Items are fundamentally different
- They have different descriptions, images, or features
- Examples: different phone models, different book titles
Recommended Attribute Count
- Stick to 2-3 attributes per product maximum
- More attributes create exponentially more variants to manage
- Consider if you really need that many combinations
Deleting Variants
To remove a variant:
- Open the product
- Find the variant in the list
- Click the delete icon on that row
- Save the product
To remove an entire attribute from a product:
- In the Attributes section, click the X next to the attribute
- All variants using that attribute will be affected
- Save the product
Warning: Removing an attribute deletes all variants that use it. Make sure this is what you want before saving.
Next Steps
- Organizing with categories and collections - Group products with similar attributes
- Managing inventory - Track stock per variant
- SEO and meta information - Optimize product pages for search
Common Issues
"All variants must specify a non-empty attribute value"
When you add attributes to a product, every variant must have a value for each attribute. Check that all cells in your variant table are filled in.
Variants not showing on storefront
Ensure each variant has:
- A price greater than 0
- Stock greater than 0 (unless backorders are enabled)
- The product status is set to Active
Color swatches not appearing
Make sure you entered a valid hex color code for the color attribute value. The format should be #RRGGBB (e.g., #FF5733).