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

Hace 1 mes
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?
Hace 1 mes
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; }
Hace 1 mes
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.
Hace 1 mes
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
Hace 1 mes
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