I think Order/Details.cshtml is to big and do a lot of work. It should be seperated.
I think each section should be a cshtml file or partial action.
OrderOverview --> Content of .order-overview
OrderDetails --> Content of .order-details-area
Shipments --> Content of .shipments
OrderNotes--> Content of .order-notes
Products --> Content of .products
Options --> Content of .options
Totals --> Content of totals
After this implementation Orders/Details.cshtml look like this.
<div class="page order-details-page">
@if (!Model.PrintMode)
{
<div class="page-title">
<h1>@T("Order.OrderInformation")</h1>
<a href="@Url.RouteUrl("PrintOrderDetails", new { orderId = Model.Id })" target="_blank" class="button-2 print-order-button">@T("Order.Print")</a>
@if (!Model.PdfInvoiceDisabled)
{
<a href="@Url.RouteUrl("GetOrderPdfInvoice", new { orderId = Model.Id })" class="button-2 pdf-invoice-button">@T("Order.GetPDFInvoice")</a>
}
</div>
}
<div class="order-overview">
@Html.Partial("OrderOverview",Model)
@Html.Widget("orderdetails_page_overview", Model.Id)
</div>
<div class="order-details-area">
@Html.Partial("OrderDetailsArea",Model)
</div>
@if (!Model.PrintMode && Model.Shipments.Count > 0)
{
<div class="section shipments">
@Html.Partial("Shipments",Model)
</div>
}
.
.
.
.
</div>
Why i suggest this?
I add some new fieds to orders for a customer (3.90) and i have to override all Details.cshtml file for this fields.