Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to forums.ablecommerce.com. Please use your AbleCommerce username and password to Login. Forums Registration.



Go to last post Go to first unread
#1 Posted : Wednesday, March 4, 2020 12:10:51 PM(UTC)

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 5/20/2019(UTC)
Posts: 48

Thanks: 1 times

I have two features would like to add to the V9.0 that Mazhar had helped me on V7.0 and the Gold. But I found that it was different on V9 and I couldn't do it

1) Display "!" (Color Blue & bold) on Orders if a note was left by a customer. Currently, we have to click into the order and click "Note" in order to tell if there is any note left by the customer. If it a very important feature because some customer may left a special instruction for orders and if we missed it, the customer may got pissed :(

2) Display "Next Day" service and highlight the order (the row under Orders)if a customer selected 'Next Day' service. Due to the cut off time, we have to prioritize Next Day or Second order when order received.


Wanna join the discussion?! Login to your AbleCommerce Forums forum account. Forums Registration.

#2 Posted : Thursday, March 5, 2020 4:15:53 AM(UTC)

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 64

Thanks: 5 times
Was thanked: 8 time(s) in 7 post(s)
It was discussed for gold in this thread

In order to make similar updates in AC9, you will have to update the /Area/Admin/Views/Orders/_ListOrder.cshtml file. Please take a backup of this file before making any updates. Then edit the file and replace all its content with the following content.

NOTE This code shared below is taken from 9.0.1, if you are using a different version please compare the code with your file and then manually copy the updates needed.


@model StaticPagedList<OrderListItemModel>
@using CommerceBuilder.Extensions
@using CommerceBuilder.Common

    var routeValues = new {
        modelData = ViewBag.OrderFilter,
        SortExpression = ViewBag.SortExpression,

    var gridActions = new List<IGridAction>();
    gridActions.Add(new GridAction("PAY", "Process Payments"));
    gridActions.Add(new GridAction("SHIP", "Mark Shipped"));
    gridActions.Add(new GridAction("SHIPOPT", "Mark Shipped with Options"));
    gridActions.Add(new GridAction("CANCEL", "Cancel", true));

    gridActions.Add(new GridAction("INVOICE", "Print Invoices"));
    gridActions.Add(new GridAction("PACKSLIP", "Print Packing Slips"));
    gridActions.Add(new GridAction("PULLSHEET", "Print Pull Sheets", true));

    var statuses = ViewBag.OrderStatuses as List<KeyValuePair<string, string>>;
    for (int i = 0; i < statuses.Count; i++)
        var status  = statuses[i];
        if (i == statuses.Count - 1)
            gridActions.Add(new GridAction("OS_" + status.Key, "Change status to " + status.Value, true));
            gridActions.Add(new GridAction("OS_" + status.Key, "Change status to " + status.Value));

    gridActions.Add(new GridAction("EXPORT", "Export selected"));
    gridActions.Add(new GridAction("DELETE", "Delete selected"));

    GridRenderOptions options = new GridRenderOptions("ListOrdersPaged", "Orders", routeValues, new AjaxOptions()
        HttpMethod = "GET",
        UpdateTargetId = "list-order-container",
        InsertionMode = InsertionMode.Replace,

    options.Commands = gridActions.ToArray();    
    options.ShowCountLabel = true;
<div class="ibox float-e-margins">
    <div class="ibox-title">
        <h5>@Model.TotalItemCount Orders</h5>
    <div class="ibox-content">
       @if (!Model.Any())
            <h4 class="no-results">
                There are no orders matching the search criteria.
           using (Ajax.BeginForm("UpdateSelectedOrders", null, new AjaxOptions() { UpdateTargetId = "list-order-container", OnSuccess = "UpdateSuccess" }, new { id = "update-selected-form" }))
                @Html.Hidden("page", Model.PageNumber)                
                @Html.Hidden("AllSelected", false)
                @Html.Hidden("Command", string.Empty)
                @Html.Hidden("ModalData", (string)ViewBag.OrderFilter)
                using (var grid = Html.BeginGrid(Model, options))
                    <table class="table table-stripped">                
                                <th><input type="checkbox" class="select-all-items check-box" name="input[]"></th>                                
                                <th>@grid.SortLink("Order", "OrderNumber")</th>
                                <th data-hide="phone,tablet">@grid.SortLink("Date", "OrderDate")</th>
                                <th class="text-center" data-hide="phone">@grid.SortLink("Order Status", "OrderStatusId")</th>                                
                                <th data-hide="phone">@grid.SortLink("Customer", "BillToLastName")</th>
                                <th class="text-right">@grid.SortLink("Amount", "TotalCharges")</th>
                                <th class="text-center" data-hide="phone">Payment</th>
                                <th class="text-center" data-hide="phone">Shipment</th>
								<th class="text-left">Shipping</th>
                                <th class="text-right">Notes</th>
                                <th class="text-right">Action</th>
                                <th class="text-center">Quickview</th>
                            @foreach (var item in Model)
                                var order = AbleContext.Container.Resolve<CommerceBuilder.Orders.IOrderRepository>().Load(item.Id);
                                List<string> shipmethods = order.Shipments.Select(shipment => shipment.ShipMethodName).ToList();
                                string style = string.Empty;
                                if (item.OrderStatus.Contains("Problem"))
                                    style = "background-color:#FF6961;";

                                if (string.IsNullOrEmpty(style) && shipmethods.Any(m => m.ToLower().Contains("next day") || m.ToLower().Contains("2nd day")))
                                    style = "background-color:yellow;";

                                bool hasNotes = order.Notes.Any(note => note.NoteType == CommerceBuilder.Orders.NoteType.Public);

                                string RowId = "row_" + item.Id;
                                <tr id="@RowId" style="@(style)">                                    
                                    <td>@Html.CheckBox("ORDER_CHK_" + item.Id, new { @class = "check-box" })</td>
                                    <td><a href="@Url.Action("ViewOrder", new { orderNumber = item.OrderNumber })">@(item.OrderNumber)</a></td>
                                        <small>@(string.Format("{0:G}", item.OrderDate))</small>
                                    <td class="text-center"><span class="label label-fixed label-plain">@(item.OrderStatus)</span></td>
                                        @(string.Format("{1}, {0}", item.BillToFirstName, item.BillToLastName))
                                        @if (!string.IsNullOrEmpty(item.BillToCompany))
                                        { <br />@(item.BillToCompany) }
                                    <td class="text-right">@Html.DisplayFor(m => item.TotalCharges)</td>
                                    <td class="text-center">
                                        <span class="label label-fixed @(item.PaymentStatusStyle)">@(item.PaymentStatus)</span>
                                    <td class="text-center">
                                        <span class="label label-fixed @(item.ShipmentStatusStyle)">@(item.ShipmentStatus)</span>
                                            @(string.Join(",", shipmethods.ToArray()))
									<td class="text-center">
                                            if (hasNotes)
                                                <a href="@Url.Content(string.Format("~/Admin/Orders/ViewOrder/{0}?currentTab=OrderNotes", item.Id))"><i style='color:#1c84c6;' class="fa fa-2x fa-exclamation-circle"></i></a>
                                    <td class="text-right">
                                        <div class="btn-group">
                                            <a href="@Url.Action("ViewOrder", new { orderNumber = item.OrderNumber})" class="btn-white btn btn-sm">View Order</a>
                                    <td class="text-center">
                                        <a id="btn-order-summary" data-row-id="@RowId" data-action="@Url.Action("ViewOrderSummary", "Orders", new { orderId = item.Id })" data-toggle="modal" data-target="view-order-summary"><i class="fa fa-search fa-2x"></i></a>

Any order with problem status will be highlighted in red, any order having ship method next day or 2nd day will be highlighted in yellow. Shipment columns will show the ship methods associated with the order. Lastly, notes column will have an exclamation sign if there is at least one public note and if you click the exclamation sign it will take you to the order notes for that order.

Edited by user Thursday, March 5, 2020 4:22:25 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.