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!
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
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
|
|
|
|
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!
|
|
|
|
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.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close