How can I change the sorting by orders in the admin panel?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 anni tempo fa
How can I change the sorting by orders in the admin panel by the value of the attribute of the product’s property?
4 anni tempo fa
Specify the order parameter of ProductServce.SearchPtoduct method in ProductModelFactory as below code.

var products = _productService.SearchProducts(showHidden: true,
                categoryIds: categoryIds,
                manufacturerId: searchModel.SearchManufacturerId,
                storeId: searchModel.SearchStoreId,
                vendorId: searchModel.SearchVendorId,
                warehouseId: searchModel.SearchWarehouseId,
                productType: searchModel.SearchProductTypeId > 0 ? (ProductType?)searchModel.SearchProductTypeId : null,
                keywords: searchModel.SearchProductName,
                pageIndex: searchModel.Page - 1, pageSize: searchModel.PageSize,
                overridePublished: overridePublished
                orderBy: //your sorting value);


To be noted, sorting options are fixed. If you want to sort by any other property than those, then you have to add extra enum property in ProductSortingEnum and modify stored procedure ProductLoadAllPaged.
4 anni tempo fa
mhsjaber wrote:
Specify the order parameter of ProductServce.SearchPtoduct method in ProductModelFactory as below code.

var products = _productService.SearchProducts(showHidden: true,
                categoryIds: categoryIds,
                manufacturerId: searchModel.SearchManufacturerId,
                storeId: searchModel.SearchStoreId,
                vendorId: searchModel.SearchVendorId,
                warehouseId: searchModel.SearchWarehouseId,
                productType: searchModel.SearchProductTypeId > 0 ? (ProductType?)searchModel.SearchProductTypeId : null,
                keywords: searchModel.SearchProductName,
                pageIndex: searchModel.Page - 1, pageSize: searchModel.PageSize,
                overridePublished: overridePublished
                orderBy: //your sorting value);


To be noted, sorting options are fixed. If you want to sort by any other property than those, then you have to add extra enum property in ProductSortingEnum and modify stored procedure ProductLoadAllPaged.



I need to change the method public virtual ActionResult OrderList(DataSourceRequest command, OrderListModel model), what would be ranking by product property in the order, date criterion
4 anni tempo fa
I have a product order that has a date property, I need to select all orders for this property in the admin panel in the list of all orders
4 anni tempo fa
You need to modify the Model, Controller, and View to support the additional search criteria, and then also modify the ProductService.SearchProducts() and modify stored procedure ProductLoadAllPaged.

Alternately, you could create a new 'Report'.
4 anni tempo fa
be careful from doing changement directly to the standard code, the best approach is to create plugins for any changement, otherwise, you may face a big problems during migrations especially that the nopcommerce code is changing so much since the version 4.0
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.