How to display OrderSubtotal in \Areas\Admin\Views\Order\List.cshtml?

2 tháng cách đây
4.60.6

I want to display OrderSubtotal in here:
//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",
                                        });
                                    }


How can I do it?
2 tháng cách đây
you can add a new column
                                        gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.OrderSubtotalInclTax))
                                        {
                                            Title = T("Admin.Orders.Fields.OrderSubtotalInclTax").Text,
                                            Width = "100",
                                        });
Depends on what value you wan to show

        public string OrderSubtotalInclTax { get; set; }
        public string OrderSubtotalExclTax { get; set; }
        public string OrderSubTotalDiscountInclTax { get; set; }
        public string OrderSubTotalDiscountExclTax { get; set; }
2 tháng cách đây
Yidna wrote:
you can add a new column
                                        gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.OrderSubtotalInclTax))
                                        {
                                            Title = T("Admin.Orders.Fields.OrderSubtotalInclTax").Text,
                                            Width = "100",
                                        });
Depends on what value you wan to show

        public string OrderSubtotalInclTax { get; set; }
        public string OrderSubtotalExclTax { get; set; }
        public string OrderSubTotalDiscountInclTax { get; set; }
        public string OrderSubTotalDiscountExclTax { get; set; }


I tried it. It doesn't work.
2 tháng cách đây
Ok yes sorry the fields are in the model but not populated in Admin
You would need to populate the fields in the Factory routine
        public virtual async Task<OrderListModel> PrepareOrderListModelAsync(OrderSearchModel searchModel)
in src\Presentation\Nop.Web\Areas\Admin\Factories\OrderModelFactory.cs
2 tháng cách đây
danielaguero wrote:
4.60.6

I want to display OrderSubtotal in here:
//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",
                                        });
                                    }


How can I do it?

DM me for help
On remotely I will have help