logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
dennis3396677  
#1 Posted : Tuesday, April 20, 2021 1:23:13 PM(UTC)
dennis3396677

Rank: Member

Groups: Authorized User, Developers
Joined: 4/7/2021(UTC)
Posts: 18

I have a category in my store called New Arrivals. I would like to sort the products that display in this category by date, newest first and only show 100 of the newest products in that category. Thanks in advance for any help!

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyartiwana25816656  
#2 Posted : Wednesday, April 21, 2021 3:10:59 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 703

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
This is not possible with the default implementation of the product listing function.


1- You have to customize the backend query for the AdvancedSearch function of the class ProductRepository. Add P.CreatedDate in the select clause of the query
2- Add { "CreatedDate DESC" , "Newer First" }, in the sorting options (dropdown selection list) in _CategoryGridPage.cshtml
dennis3396677  
#3 Posted : Thursday, April 22, 2021 10:01:52 AM(UTC)
dennis3396677

Rank: Member

Groups: Authorized User, Developers
Joined: 4/7/2021(UTC)
Posts: 18

Thank you for your reply. I found where to add the option in the dropdown list in the _CategoryGridPage.cshtml file but I cannot figure out where to add the query clause. What file would I find that in please to add the P.CreatedDate in the select clause of the query. Thank you!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.