Close

Populating Extra Sort Options In Admin Panel

mkzaman
5 years ago
#12288 Quote
Avatar
  • 20
Ajax filter provided us the opportunity to select default sort option for category page.



I didn't find the view file for admin panel, so I assume it's embedded. Is there any way to include more sort options in the dropdown rather than the default nop sort options? I just want to know how to populate more options in the dropdown. 
hristian.dimov
5 years ago
#12289 Quote
Avatar
  • Moderator
  • 386
mkzaman wrote:
Ajax filter provided us the opportunity to select default sort option for category page.



I didn't find the view file for admin panel, so I assume it's embedded. Is there any way to include more sort options in the dropdown rather than the default nop sort options? I just want to know how to populate more options in the dropdown. 


Hi,

we are using ProductSortingEnum enumaration from nopCommerce, so if you need to add more sorting options you need to make changes in this file: "\Libraries\Nop.Core\Domain\Catalog\ProductSortingEnum.cs" / you need to have the source code version of nopCommerce /.

Hope this helps!
Regards,
Hristian Dimov
Nop-Templates.com
mkzaman
5 years ago
#12297 Quote
Avatar
  • 20
hristian.dimov wrote:
Ajax filter provided us the opportunity to select default sort option for category page.



I didn't find the view file for admin panel, so I assume it's embedded. Is there any way to include more sort options in the dropdown rather than the default nop sort options? I just want to know how to populate more options in the dropdown. 

Hi,

we are using ProductSortingEnum enumaration from nopCommerce, so if you need to add more sorting options you need to make changes in this file: "\Libraries\Nop.Core\Domain\Catalog\ProductSortingEnum.cs" / you need to have the source code version of nopCommerce /.

Hope this helps!


Thanks. It works.
mkzaman
5 years ago
#12298 Quote
Avatar
  • 20
One more thing, how do you generate the string showing? Like Price: Low to High for PriceAsc Enum Value. When I have added SkuAsc in the enum file, it shows Sku Asc in the admin panel. What's the way to beautify the string we want to show in the admin panel.
hristian.dimov
5 years ago
#12300 Quote
Avatar
  • Moderator
  • 386
mkzaman wrote:
One more thing, how do you generate the string showing? Like Price: Low to High for PriceAsc Enum Value. When I have added SkuAsc in the enum file, it shows Sku Asc in the admin panel. What's the way to beautify the string we want to show in the admin panel.


Hi,

in nopCommerce the enums are localized in this way: Enums.Nop.Core.Domain.Catalog.ProductSortingEnum.CreatedOn. So, basically, you need to add a new resource corresponding to the new enum value. You can add it in the Administration -> Configuration -> Languages -> View string resources and click on the "Add new record". In the resource name add "Enums.Nop.Core.Domain.Catalog.ProductSortingEnum.SkuAsc" and for the value "Sku acdending" for example.

Hope this helps!
Regards,
Hristian Dimov
Nop-Templates.com