Developer forum

Forum » Ecommerce - Standard features » Active variant count

Active variant count

Ricardo Pereira
Ricardo Pereira
Reply

Hi Guys,

I'm doing a product list by Index and need to know how many active variants the product has. I notice that the product api has the property "VariantProductCount" with the right value, but no Tag is generated with this value, only a total variant count that contains the inactive products - product.GetString("Ecom:Product.VariantCount"). Is there any way to have a product tag with the active variant count?

DW version: 8.9.2.13

 

Thanks,

Ricardo


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

It seems not to exist, you can use VariantCombinations loop and Ecom:VariantCombination.Product.Active inside that to calculate active-not active variant combinations. Perhaps, somebody from development can comment the feature better.

BR, Oleg QA 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You could do what Oleg suggests, but that would come with a potential too big performance hit.

I would rather run some logic on the SQL server that updates a field - maybe a custom product field - with the information

Votes for this answer: 1
 
Ricardo Pereira
Ricardo Pereira
Reply

Thank you both!

 

You must be logged in to post in the forum