Discussions

Show multiple variations in view

Hi there,

We have products with two variables for variations: color and size. When we create a view on the product display we get the unique products. If we create a view with commerce products we get a list of all possible combinations of product sizes and colors.

Now we would like to have a view which shows all products for each color, but not size. So for example:

Product X
Colors: Red, Green, Blue
Sizes: 24, 25, 26

Product Y
Colors: Red, Green, Black
Sizes: 25, 26

Using product display results in:
Product X, Product Y

Using commerce products results in:
Product X red - 24
Product X red - 25
Product X red - 26
Product X green - 24
(..) (<- you get the point I guess)
Product Y Black - 26

What we want to accomplish:
Product X red
Product X green
Product X blue
Product Y Red
Product Y green
Product Y blue

Is that possible? We use the Search API module for the facets by the way. So using 'aggregrate fields' (if that would be the solution anyway) is not possible.

Posted: Aug 27, 2013

Comments

wekko on August 27, 2013

I might have found a solution (didn't implement it yet):
Create a product display per color, pick a different color at the first position for every product display. Also add an extra color field (not visible) which can be used for the facet filtering and is different for those three displays. For example, two product displays:

Product X Red
Product X Red - size 24
Product X Red - size 25
Product X Red - size 26
Product X Blue - size 24
Product X Blue - size 25
Product X Blue - size 26

Product X Blauw
Product X Blue - size 24
Product X Blue - size 25
Product X Blue - size 26
Product X Red - size 24
Product X Red - size 25
Product X Red - size 26

So 6 commerce products and 2 product displays in case of 2 colors with 3 sizes.

zoltan on August 29, 2013

I solved this by adding "show variation" checkbox to my variation type and viewing only variations with that field checked - which would be only one variation per size.