Developer forum

Forum » Ecommerce - Standard features » RE: VariantCombinations Orderby in foreach

RE: VariantCombinations Orderby in foreach

Michael John
Reply

Hello,

I have a loop:

@foreach (var item in GetLoop("VariantCombinations")) {

}

In this loop, I would like to order the items by Ecom:VariantCombination.VariantText.

Can't seem to find anything useful in the documentation on OrderBy?(e.g OrderBy(x => x.GetString("Ecom:VariantCombination.VariantText)))

 


Replies

 
Nicolai Høeg Pedersen
Reply

GetLoop just returns a Generic.List of LoopItem and it supports LINQ.

See this one: http://developer.dynamicweb.com/forum/templates/razor-groups-orderby-with-linq.aspx

BR Nicolai

 

You must be logged in to post in the forum