Developer forum

Forum » Development » VariantGroups and Variant compinations

VariantGroups and Variant compinations


Reply
Hi,

I'm wondering if it is possible to make variants display in two different dropdowns.
The two variantgroups could be "size" and "color".

When "size" is picked in the dropdown either a post is made with the first variant "VO1" or it just stay selected. 

With the first variant "VO1" is chosen I only wan't to display the actuall variant compinations in the other dropdown "color".

I've tryed making this in jQuery and advanced xslt, but i can't seem to get the result that I've just described.

Any good ideas?

It's quit simple to make this variant picker in the same dropdown, with both varianttext listed. fx. "size - color" but it doesn't look that fancy.

I'm running DW 7.2

/Rasmus

Replies

 
Angel
Reply
Deleted by moderator...
 
Nicolai Høeg Pedersen
Reply
Hi Rasmus

In the frontend product template you have 2 options for creating variant selection in 2 different loops. VariantCombinations contains all combinations of all the variant groups. So small-blue small-red medium-blue etc.

Instead of using VariantCombinations you can use the VariantGroups loop - that will give you a list of variant dimensions (Size and Color) and inside that loop you can use VariantOptions to display the options of the dimensions (Size: Small, Medium - color:blue, red).

You can take it even further by using the VariantGroups/VariantOptions loops to generate 2 or more dropdowns, and with javascript go through the available combinations in VariantCombinations loop. So when selection size small, only the colors available in that size will display.

Attached a template with the 2 different implementations.
 
Reply
 Hi Nicolai,

We have played a bit around with those variants.
The variant group is great, but the main problem (correct me if I am wrong).  is that the variants get very confusing for the customer if there is many colors and many sizes.

ie:
blue 38
blue 39
blue 40
blue 41
red 38
red 39
red 40
red 41
yellow 38

and so on.

I have seen that some DW shops, solves the problem by creating a seperat product for each color, then there will only be one variant.

What we have seen in other e-shop, is this setup (see attachment). where one dropdown is the first variant, and next dropdown is second.

We are planning to make a .NET module for this, and I would like to hear your input to how we can make this. ?

thanks :-)
variants.png
 
Nicolai Høeg Pedersen
Reply
Hi Peter

The feature is already there...

Dynamicweb have 2 approaches in the template for making variants:
- Variant combinations with one list of all available variants.
OR
- Variant Groups, meaning x-number of dropdowns for each dimensions, i.e. Color dropdown and Size dropdown etc. Just like your attached screendump.

Both versions are available in the template of my previous post.
 
Reply
 
You need to be aware of performance problems in eCommerce...

eCommerce does not read variant combinations from cache, but executes two requests for each combination in the loop... for each and every product in a list.

/Morten
 
Reply
That's excellent :-)
 
Reply
 @Morten

Is there anything special we can do about this?

Do you mean that if a product card has 20 variants, then there will be 40 request to the server?
 
Reply
Yes, if you have variants in 5 colors and 4 sizes (20 combinations), that will result in 40+ requests when rendering variants for a product.

You could make a custom rendering of cached variants using a ProductTemplateExtender.

/Morten
 
Reply
@Morten,

ok. do you have a suggestion to how this could be done? just in suggestions.. :-)
 
Reply
No, sorry - i don't have a solution for you :)

Just to clarify, it's 40+ sql queries, not http requests.

/Morten

 

You must be logged in to post in the forum