Additional Product Sort options?

3 years ago
Hi all, I'm wondering if there can be more search options than the currently available defaults? (i.e., position, Name, price,created on)

I'd like to be able to add other search options such as Product Date (as opposed to date created), product location (i.e., Products from Boston, New York, etc).

Is this something that can be easily done or is this quite complex?
3 years ago
Forgot to mention I am using V3.40
3 years ago
Hi, you need to customize code for this.
1. Add Your new values to ProductSortingEnum.cs here(/Libraries/Nop.Core/Domain/Catalog/ProductSortingEnum.cs)
2. Modify ProductLoadAllPaged store procedure according to your sorting requirements.
3. Add language resources for your enum values for display purpose in dropdowns.

Hope this helps.
3 years ago
By default sorting options are Name,Price,CreatedOnUtc and DisplayOrder. If you want to add more options to sort, you need to change source code.If you see "ProductLoadAllPaged" Stored procedure you will get a idea.So far I understand to add more sorting option you need to change the stored procedure and related sorting code as well.
3 years ago
BostonEDIGuy wrote:
Hi all, I'm wondering if there can be more search options than the currently available defaults? (i.e., position, Name, price,created on)

I'd like to be able to add other search options such as Product Date (as opposed to date created), product location (i.e., Products from Boston, New York, etc).

It sounds like you might be better off looking at using Specification Attributes for at least some of these to allow filtering of results. The sort options are just sorting all the results in a specific order. If you want to display just the products with product location of Boston or New York you want to filter the results.

This page on the demo site shows how specification attributes can be used to filter product categories: http://demo.nopcommerce.com/notebooks and documentation on how to set them up:

http://docs.nopcommerce.com/display/nc/Specification+Attributes