Developer forum

Forum » Ecommerce - Standard features » ProductViewModel and Active varaints.

ProductViewModel and Active varaints.

Simon Nordahl
Simon Nordahl
Reply

Hi,

What are the recommended way of using Variants collection on a product page (ProductViewModel)?

As far as I can tell the ALL the variants are a part of the "Variants"-property on the ProductViewModel, but why would I want to display inactive variants?

Am I doing something wrong, or do I really have to GetProductById for each variant in order to determine if the variant is active or not and should be displayed?

 

Kind regards

Simon


Replies

 
Nicolai Pedersen
Reply

So, you see inactive variant combination on your variantinfo structure? That sounds more like a bug or missing piece of information.

 
Nicolai Pedersen
Reply

There is no Variants property on the productviewmodel...

 
Nicolai Pedersen
Reply

ok, variantinfo property contains all variants - including inactive.

TFS#88845 - will get a fix.

 
Simon Nordahl
Simon Nordahl
Reply

Wow, you are as fast as ever Nicolai :D

It was named "Variants" in 9.7 (I should have included my verion in the OP, my bad), but after the refacoring it's as you said "variantinfo " .

We have made a bandaid fix in the solution to verify that the variant is active, just wanted to be sure that I didnt miss the intented use.

 

You must be logged in to post in the forum