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

1 mese tempo fa
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?
1 mese tempo fa
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; }
1 mese tempo fa
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.
1 mese tempo fa
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
1 mese tempo fa
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