# Is it possible to get the index of products in productlist?

**URL:** <https://forum.litium.com/t/is-it-possible-to-get-the-index-of-products-in-productlist/1258>\
**Category:** Questions\
**Tags:** litium-6\
**Created:** [December 13, 2019, 3:45pm UTC](https://forum.litium.com/t/is-it-possible-to-get-the-index-of-products-in-productlist/1258 "2019-12-13T15:45:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cissi](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/cissi/32/18_2.png) [@Cissi](https://forum.litium.com/u/Cissi)\
**Post date:** [December 13, 2019, 3:45pm UTC](https://forum.litium.com/t/is-it-possible-to-get-the-index-of-products-in-productlist/1258/1 "2019-12-13T15:45:48Z")

</div>

Hi!  
Just want to get the products from a list in the same order as displayed in BO.  
Is this possible?

Right now were fetching it like this:  
var productList = \_productListService.Get(currentPageTypeDefinition.AlternativeProductList).Items  
.SelectMany(x =\> x.ActiveVariantSystemIds)  
.Select(variant =\> \_productItemViewModelBuilder.Build(\_variantService.Get(variant), currentPage.WebSite, \_cartService.Currency, WebsiteSettings.Instance.ShowProductQuantityBoxInProductLists, WebsiteSettings.Instance.ShowBuyButtonInProductLists))  
.Where(item =\> item != null)  
.ToList();

Litium version: 6.3.7

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [December 13, 2019, 4:02pm UTC](https://forum.litium.com/t/is-it-possible-to-get-the-index-of-products-in-productlist/1258/2 "2019-12-13T16:02:21Z")

</div>

You could try retrieving the product list, checking if it’s a StaticProductList, inspect if it’s property ProductsSortOrder has any values (it won’t if it’s never been sorted) and use that list to sort the original list.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [January 10, 2020, 4:02pm UTC](https://forum.litium.com/t/is-it-possible-to-get-the-index-of-products-in-productlist/1258/3 "2020-01-10T16:02:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
