is there a way to list products by the date they were added

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
pgdlc
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Mon Apr 16, 2012 2:52 pm

is there a way to list products by the date they were added

Post by pgdlc » Mon Apr 16, 2012 3:57 pm

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?

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: is there a way to list products by the date they were added

Post by david-ebt » Mon Apr 16, 2012 6:47 pm

What page are you trying to sort? If you look at the ConLib\CategoryGridPage.ascx and search for the

Code: Select all

asp:DropDownList ID="SortResults"
code. You should be able to add another list item like this:

Code: Select all

<asp:ListItem Text="Newest Products First" Value="CreatedDate DESC"></asp:ListItem>
If you look at the code behind and search for

Code: Select all

ProductDataSource.NarrowSearch
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.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

pgdlc
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Mon Apr 16, 2012 2:52 pm

Re: is there a way to list products by the date they were added

Post by pgdlc » Tue Feb 19, 2013 3:14 pm

I tried this but can't get it to work

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: is there a way to list products by the date they were added

Post by david-ebt » Wed Feb 20, 2013 10:18 am

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.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

Post Reply