Swift: 1.22.0
Dynamicweb: 9.16.2
So we have these lovely products:
- PROD1 - Pants Blue XS
- PROD2 - Pants Blue XL
- PROD3 - Pants Red XS
- PROD4 - Pants Red L
- PROD5 - Pants Yellow M
Since they are variants, we have created variant groups and options:
- Colors
- VO1 - Blue
- VO2 - Red
- VO3 - Yellow
- Sizes
- VO4 - XS
- VO5 - M
- VO6 - L
- VO7 - XL
Further on we have combined the products into a model:
- PROD1 - Pants
- PROD1 - Pants Blue XS - VO1 - VO4
- PROD2 - Pants Blue XL - VO1 - VO7
- PROD3 - Pants Red XS - VO2 - VO4
- PROD4 - Pants Red L - VO2 - VO6
- PROD5 - Pants Yellow M - VO3 - VO5
So far so good. Now we would really like to show only the colors in the product list. So expected result should be three items in the product list:
- Pants Blue
- Pants Red
- Pants Yellow
By changing the query I know we can do something like this:
- Is variant = True
- Color - First variant in group = True
The problem with this approach is that it first of all excludes all products that does not have variants, and it also excludes those who dont have colors, but only have size. Another big problem is that filters for size are not longer working. We can filter for colors, but when trying to filter by size, only the first sizes in each color is available. Not the entire range of sizes.
So the question is, how do you go proceed if you would like to:
- Only show color variants in the product list
- Be able to filter for the full range of sizes
- Not exclude non-variant products, and products with different variant groups