Sorting Featured Products Grid
Posted: Mon Apr 23, 2012 10:53 am
I have implemented a customized version of the featured products grid. Everything is working properly, but now I'd like to order the products in the grid so that certain products are always listed first. I changed the following line from
to
I figured out that I can pass "Name" as the last parameter in the "GetFeaturedProducts" method and the products would then be ordered by their names. However, I'd like to order the products by the "OrderBy" field that is updated when re-ordering products in the admin. Is there a way to accomplish this?
Code: Select all
ProductCollection products = ProductDataSource.GetRandomFeaturedProducts(0, true, IncludeOutOfStockItems, this.Size);
Code: Select all
ProductCollection products = ProductDataSource.GetFeaturedProducts(0, true, IncludeOutOfStockItems, "");