Developer forum

Forum » Development » Sorting products in the Product List

Sorting products in the Product List


Reply
Hi,



I want the products that are shown in the Product List, sorted by their name (asc or desc) or price (asc or desc).



Are there any default querystring parameters that can manage that?



I tried it via C# code using a TemplateExtender class but that failed, by using the statement:



ProductList.Sort(Dynamicweb.eCommerce.Products.ProductCollection.SortBy.Price, Dynamicweb.eCommerce.Products.ProductCollection.SortDirection.Ascending);



Any ideas?



-Emil

Replies

 
Reply


I noticed that passing "?SortBy=Price&SortOrder=Desc" to a page with a Product List actually works. Any documentation available on those and available parameters?
 
Reply
Emil Muller wrote:





I noticed that passing "?SortBy=Price&SortOrder=Desc" to a page with a Product List actually works. Any documentation available on those and available parameters?



Hi,


 


Unfortunately we haven't documented this part just yet. But based on your request we have added this assignment to our backlog of documentation issues to be completed in the nearest future.


 


Is it any specific knowledge you would like to hear more about?


 


Regards,


 


Peter

 
Reply
Terkildsen wrote: 

Is it any specific knowledge you would like to hear more about?


Not at the moment, i think we've got most things covered right now.

 

You must be logged in to post in the forum