Sandeep, i am not sure I understand your question. So you want to show the products to the end users in the same order as they are shown to the editors?
The products are sorted by the SortOrder to their respective category, so it is not a property in the products itself. This is a tricky problem I must admit - not sure I have good solution. You can of course writing a Sort method that loads the relations of the product, gets the sort order in the current category and then sorts by it. But it is not that elegant or simple ...
Wanted to know that when indexing the products in EPi find it must insert it in the order they appear in the CMS I am presume.
Also could you please confirm that if no sorting is specified in the qury paramet what criteria does it use to return product. Is it by the latest publish date.
To get Node/Entry sortOrder
var nodeEntryRelations = _relationRepository.GetParents<NodeEntryRelation>([EntryContentLink]);
var relation = nodeEntryRelations.FirstOrDefault(r => r.Parent == [NodeContentLink]);
var sortOrder = relation.SortOrder;
On our product list pages the products returned seem to be in the order they were published.
Our normal sortng seems to work fine.
search = search.OrderBy(p => p.SearchPrice());
search = search.OrderByDescending(p => p.SearchPrice());
search = search.OrderByDescending(p => p.AverageRating)
.ThenByDescending(p => p.ReviewCount);
We need the products to be returned in the order they appear in the CMS editor so that the content editors can visuall see and sort the products.
EPiServer Commerce Framework
Version: 11.8 (build: 2)