is there a way to list products by the date they were added
is there a way to list products by the date they were added
We would like for our products to display in the order in which they were added to the store, showing the newest products first. Is there a way do this?
Re: is there a way to list products by the date they were added
What page are you trying to sort? If you look at the ConLib\CategoryGridPage.ascx and search for the
code. You should be able to add another list item like this:
If you look at the code behind and search for
you can replace the SortResults.SelectedValue with "CreatedDate DESC" to hard code the sort order.
Most of the other product list pages have the same type of set up. I hope that puts you on the right trail.
Code: Select all
asp:DropDownList ID="SortResults"
Code: Select all
<asp:ListItem Text="Newest Products First" Value="CreatedDate DESC"></asp:ListItem>
Code: Select all
ProductDataSource.NarrowSearch
Most of the other product list pages have the same type of set up. I hope that puts you on the right trail.
Re: is there a way to list products by the date they were added
I tried this but can't get it to work
Re: is there a way to list products by the date they were added
Sorry, my mistake. That sort option won't work on the CategoryGridPage. The only valid sort options are based on the group by in the ProductDataSource.NarrowSearch query:
ProductId, Name, Sku, Price, MSRP, CostOfGoods, Weight, Length, Width, Height, IsFeatured, FTS.RANK, OrderBy, Manufacturer
Sorting by Product CreatedDate would require a special sort handler for the NarrowSearch results before handing them to the grid. See viewtopic.php?f=42&t=12443.
ProductId, Name, Sku, Price, MSRP, CostOfGoods, Weight, Length, Width, Height, IsFeatured, FTS.RANK, OrderBy, Manufacturer
Sorting by Product CreatedDate would require a special sort handler for the NarrowSearch results before handing them to the grid. See viewtopic.php?f=42&t=12443.