Developer forum

Forum » Templates » RE:
Peter Munkholm
Reply

Hej,

I en varegruppe liste, giver denne ikke en liste over variant muligheder på hver vare i gruppen, men en liste over samtlige variant muligheder i alle variant grupper. Er det ikke en fejl?

<!--@LoopStart(Products)-->
      <!--@LoopStart(VariantGroups)-->
          <div>
          <!--@Ecom:VariantGroup.Label-->: <select>
            <!--@LoopStart(VariantAvailableOptions)-->
              <option id="<!--@Ecom:VariantOption.ID-->" value="<!--@Ecom:VariantOption.ID-->"><!--@Ecom:VariantOption.Name--></option>
            <!--@LoopEnd(VariantAvailableOptions)-->
          </select>
          </div>
        <!--@LoopEnd(VariantGroups)-->
<!--@LoopEnd(Products)-->


Replies

 
Nicolai Høeg Pedersen
Reply

Hi

In English please...

The VariantGroups should only be the groups that is attached to the product. The options will show all options in the variant group if you use the loop VariantOptions and only the attached options when using VariantAvailableOptions.

So your example should only show available options.

What version are you on and we need a link to see how you configured this.

BR Nicolai

 
Peter Munkholm
Reply

Saddly it's a B to B shop behind a login. I can't provide a login here.

http://gottfred.dk/da-dk/shop/nrg-webshop/vb-enterprise

We tried both VariantOptions and VariantAvailableOptions, the output is identical, and both contain about 50% more variant options than selected on the product.

It's version Dynamicweb.dll 8.6.1.25

 
Nicolai Høeg Pedersen
Reply

ok, I'll have QA test it locally and see what they come up with.

Will get back!

 
Oleg Rodionov
Reply

HI all,

Peter,

I've tested the issue on your site with test content temporarily created and template updated as follows:

Variants options:  
<!--@LoopStart(VariantGroups)-->
<select id="SelectVariantId" onchange="SetVariantOption(this)" class="form-control">
  <option selected="selected">V&aelig;lg Størrelse</option>
  <!--@LoopStart(VariantOptions)-->   
  <option value="<!--@Ecom:VariantOption.VariantID-->"><!--@Ecom:VariantOption.Name--></option>  
  <!--@LoopEnd(VariantOptions)-->
</select>  
<!--@LoopEnd(VariantGroups)--> <br>

Variant Available Options  
<!--@LoopStart(VariantGroups)-->
<select id="SelectVariantId" onchange="SetVariantOption(this)" class="form-control">
  <option selected="selected">V&aelig;lg Størrelse</option>
  <!--@LoopStart(VariantAvailableOptions)-->   
  <option value="<!--@Ecom:VariantOption.VariantID-->"><!--@Ecom:VariantOption.Name--></option>  
  <!--@LoopEnd(VariantAvailableOptions)-->
</select>  
<!--@LoopEnd(VariantGroups)-->

the both option sets look like as expected (as Nicolai has already mentioned above). See http://screencast.com/t/MwpdMb01XT for proof, please. Your can check the variant group options and available options of the test product at the site backend by yourself to exnsure that all is performed properly. (I've not shown extra test conditions due to the security policy).

The same valid behavior is on our test site based on last DW version. 

BR, Oleg QA 

 

You must be logged in to post in the forum