Adding an additional Order Status to 4.50.3

3 months ago
I finally have figured it out. Everything that I have written above applies except the part about the OrderStatus.cs file. What finally solved this for me was I went into the Configuration Manager for the entire solution and discovered that not all of the projects were configured to Build. Once I changed that so that all of the projects build, the Downloaded order status began showing up. I also went back and commented out everything in Order.Status.cs and this time the build failed with numerous compiler errors.

I'm laughing at myself for taking so long to discover this. Hopefully this will help someone in the future.
2 weeks ago
Hi,

I've also added an additional order status to the enum at Nop.Core\Domain\Orders\OrderStatus.

This works fine, except the new order status does not have a colour.

Can someone tell me how to assign a colour. I'm aslo not sure what the value for the OrderStatus means. I just made it = 11 after the pending one which = 10.

public enum OrderStatus
{
    /// <summary>
    /// Pending
    /// </summary>
    Pending = 10,

    /// <summary>
    /// On Order
    /// </summary>
    OnOrder = 11,

    /// <summary>
    /// Processing
    /// </summary>
    Processing = 20,

    /// <summary>
    /// Complete
    /// </summary>
    Complete = 30,

    /// <summary>
    /// Cancelled
    /// </summary>
    Cancelled = 40
}
2 weeks ago
I figured it out.

The number assigned to the order status is the order status id.
It is also used to determine what color to choose in the views.

I had to update the styles.css to include my new colour.
Example: Add the following to styles.css

span.grid-report-item.hotpink {
  background-color: #ff69b4;
  color: #fff;
}

Then in four views where this is used
1) Areas/Admin/Views/Affiliate/_CreateOrUpdate.Orders.cshtml
2)Areas/Admin/Views/Customer/CreateOrUpdate.Orders.cshtml
3)Areas/Admin/Views/Home/_LatestOrders.cshtml
4)Areas/Admin/Views/Order/List.cshtml

Example:
function renderColumnOrderStatus(data, type, row, meta) {
    var color;
    switch (row.OrderStatusId) {
        case 10:
            color = 'yellow';
            break;
        case 11:
            color = 'hotpink';
            break;
        case 20:
            color = 'blue';
            break;
        case 30:
            color = 'green';
            break;
        case 40:
            color = 'red';
            break;
    }
    return '<span class="grid-report-item ' + color + '">' + data + '</span >';
}