Developer forum

Forum » Feature requests » Variant-loop containing all selected available options on a given product

Variant-loop containing all selected available options on a given product

Mads Ulsø Østergaard
Reply

Hey all,

 

I could really use a loop, inside the VariantGroups loop, that contains all the variants selected on a given product.

 

An example

Let's say I have a jacket, which is available in these combinations:

    Large Black

    Large Purple

    Medium Red

    Medium Yellow

 

Instead of having to script my way out of all the available variants, I would like a loop inside VariantGroups, which contains the values Large and Medium, and ONLY those values, because they're the only ones selected as available variants in the backend, in that VariantGroup. And then a loop that contains the selected color values, Black, Purple, Red and Yellow, and only those colors - even if other colors are available in the backend.

 

Currently, the only way to work around this, is to write out all of the variants in a given group, and filter them out by comparing them with the available variant combinations.

 

We could call it VariantAvailableOptions.

 

Have a great weekend,

Mads


Replies

 
Jesper Holm Damgaard
Reply

+1

 
Martin Nielsen
Reply

+1

I like it a lot!

 
Nuno Aguiar
Reply

+1

 

We currently load all variants and variant groups in javascript, and update the variant options according to the first choice.

 

Not pretty or easy, but it works. Using Data Management to do some ajax calls is also a solution we can develop, but if it was standard would be sweet

 
Nicolai Høeg Pedersen
Reply

Brilliant suggestion.

 

I've added it to the backlog - not sure it can make it to 8.3 but hopefully soon thereafter.

 

BR Nicolai

 
Anders Ebdrup
Reply

+1

 
Michael Houmark
Reply

Tillader mig at trække den her frem igen.

Er den kommet med i 8.4?

 
Asger Munkholm Højfeldt
Reply

Hi Michael - it was already released in 8.3.1 - http://developer.dynamicweb-cms.com/releases/dynamicweb-8-3-1.aspx

//Asger