When you shop online, you notice that the same product is available in various sizes, colors, materials, and price points. These purchasing options are product variants. Let’s take t-shirts, for example. They can be in different sizes and colors. Your main product is a t-shirt, but a variant will be a white t-shirt size medium. And for flight tickets, variants can be Economy, Premium, or Business class.
It is quite common to have multidimensional variants. Shoes differ by size, color, and width, while laptops by CPU, memory and storage size, and graphic card.
Modeling product variants in an e-commerce catalog can be tricky, especially when you have a ton of variations to manage. It offers a powerful way to arrange product data, but when done incorrectly can lead to very large data sizes and cause performance and data management issues.
Here are a few tips for modeling product variants in an e-commerce catalog:
⚠Use clear and descriptive names for each variant, such as “Large Blue T-Shirt” or “Red Suede Shoes – Size 8.5.” This will make it easier for customers to find the specific product they are looking for.
⚠ Use a product attribute system to define variant dimensions. A product attribute is a characteristic of a product that can be used to classify or describe it. For example, a product attribute for a t-shirt might be “size,” while a product attribute for a pair of shoes might be “color.”
⚠Don’t create products with too many variant dimensions, which may lead to performance problems. In a t-shirt example, 5 colors, 10 sizes, and 4 fabrics make a selection of 200 possible combinations. You can model this as a single Product which has 200 Product Variants, but I would recommend modeling this as multiple products instead, taking one of the variable attributes (fabric, for example) and using that as a Product (cotton t-shirt and linen t-shirt) and creating variants for other attributes color & size.
⚠ Try out a few different options: Don’t commit to a product model before seeing if it will work in some typical and not-so-typical scenarios!
Use the following approach to modeling your Catalog:
⚠Product URL slugs, display names, and search keywords are modeled on main products, not variants: Keep this in mind when optimizing your product modeling for Search Engine Optimization (SEO) purposes.
⚠Tax categories are modeled on the product level as well. When deciding on what variables to model as product variants, make sure that all variants must share the same tax category.
And now, let’s look at what parameters can be variant specific in an E-commerce Catalog:
- A variant may require its own images
- A variant may have a different price that will overwrite the product price because it is more expensive, or a merchant may decide to put red t-shirts on sale, for example.
- A variant can have different attributes
and, of course, the stock is always managed on the variant level, with the availability of the main product calculated as an aggregate of the availability of all its variants. Red t-shirts are out of stock, while blue and green are available.