@model OrderSearchModel @inject IStoreService storeService @using Nop.Services.Stores @{ //page title ViewBag.PageTitle = T("Admin.Orders").Text; //active menu item (system name) NopHtml.SetActiveMenuItemSystemName("Orders"); } @{ const string hideSearchBlockAttributeName = "OrdersPage.HideSearchBlock"; var hideSearchBlock = await genericAttributeService.GetAttributeAsync(await workContext.GetCurrentCustomerAsync(), hideSearchBlockAttributeName); } @if (Model.LicenseCheckModel.BlockPages != true) {

@T("Admin.Orders")

@await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.OrderListButtons, additionalData = Model })
@{ var gridModel = new DataTablesModel { Name = "orders-grid", UrlRead = new DataUrl("OrderList", "Order", null), SearchButtonId = "search-orders", Length = Model.PageSize, LengthMenu = Model.AvailablePageSizes, FooterCallback = !Model.IsLoggedInAsVendor ? "ordersfootercallback" : null, FooterColumns = !Model.IsLoggedInAsVendor ? 10 : 0, Filters = new List { new FilterParameter(nameof(Model.StartDate), typeof(DateTime?)), new FilterParameter(nameof(Model.EndDate), typeof(DateTime?)), new FilterParameter(nameof(Model.OrderStatusIds)), new FilterParameter(nameof(Model.PaymentStatusIds)), new FilterParameter(nameof(Model.ShippingStatusIds)), new FilterParameter(nameof(Model.StoreId)), new FilterParameter(nameof(Model.VendorId)), new FilterParameter(nameof(Model.WarehouseId)), new FilterParameter(nameof(Model.BillingEmail)), new FilterParameter(nameof(Model.BillingPhone)), new FilterParameter(nameof(Model.BillingLastName)), new FilterParameter(nameof(Model.BillingCountryId)), new FilterParameter(nameof(Model.PaymentMethodSystemName)), new FilterParameter(nameof(Model.ProductId)), new FilterParameter(nameof(Model.OrderNotes)) } }; gridModel.ColumnCollection = new List { new ColumnProperty(nameof(OrderModel.Id)) { IsMasterCheckBox = true, Render = new RenderCheckBox("checkbox_orders"), ClassName = NopColumnClassDefaults.CenterAll, Width = "50" }, new ColumnProperty(nameof(OrderModel.CustomOrderNumber)) { Title = T("Admin.Orders.Fields.CustomOrderNumber").Text, Width = "80" } }; //a vendor does not have access to this functionality if (!Model.IsLoggedInAsVendor) { gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.OrderStatus)) { Title = T("Admin.Orders.Fields.OrderStatus").Text, Width = "100", Render = new RenderCustom("renderColumnOrderStatus") }); } gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.PaymentStatus)) { Title = T("Admin.Orders.Fields.PaymentStatus").Text, Width = "150" }); //a vendor does not have access to this functionality if (!Model.IsLoggedInAsVendor) { gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.ShippingStatus)) { Title = T("Admin.Orders.Fields.ShippingStatus").Text, Width = "150" }); } gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.CustomerEmail)) { Title = T("Admin.Orders.Fields.Customer").Text, Render = new RenderCustom("renderColumnCustomer") }); gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.StoreName)) { Title = T("Admin.Orders.Fields.Store").Text, Width = "100", Visible = (await storeService.GetAllStoresAsync()).Count > 1 }); gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.CreatedOn)) { Title = T("Admin.Orders.Fields.CreatedOn").Text, Width = "120", Render = new RenderDate() }); //a vendor does not have access to this functionality if (!Model.IsLoggedInAsVendor) { gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.OrderTotal)) { Title = T("Admin.Orders.Fields.OrderTotal").Text, Width = "100", }); } gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.Id)) { Title = T("Admin.Common.View").Text, Width = "50", ClassName = NopColumnClassDefaults.Button, Render = new RenderButtonView(new DataUrl("~/Admin/Order/Edit")) }); var orderSummaryColumnNumber = 8; } @await Html.PartialAsync("Table", gridModel)
} @*export selected (XML). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@
@*export selected (Excel). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@
@*Print packaging slips selected (XML). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@
@*import orders form*@