Hi there,
If you want to accomplish it by modifying only on view level, then this is for you.
Note: I must say it's not a good process to do if you want to do by source code modification.
Reference and injected service
@*Custom Start*@
@using Nop.Core.Infrastructure;
@using Nop.Services.Shipping;
@using Nop.Services.Orders;
@using Nop.Services.Catalog;
@using Nop.Services.Localization;
@using Nop.Services.Seo;
@*Custom End*@
@*Custom Start*@
@{
var shipmentService = EngineContext.Current.Resolve<IShipmentService>();
var orderService = EngineContext.Current.Resolve<IOrderService>();
var productService = EngineContext.Current.Resolve<IProductService>();
var localizationService = EngineContext.Current.Resolve<ILocalizationService>();
var urlRecordService = EngineContext.Current.Resolve<IUrlRecordService>();
}
@*Custom End*@
On Model.Shipments loop after the table row </tr>
//Custom Start
var shipment = shipmentService.GetShipmentById(item.Id);
@if (shipment != null && shipment.ShipmentItems.Any())
{
<tr>
<td colspan="6">
<table class="data-table">
<colgroup>
@if (Model.ShowSku)
{
<col width="1" />
}
<col />
<col />
</colgroup>
<thead>
<tr>
@if (Model.ShowSku)
{
<th class="sku">
@T("Order.Shipments.Product(s).SKU")
</th>
}
<th class="name">
@T("Order.Shipments.Product(s).Name")
</th>
<th class="quantity">
Qty Ordered
</th>
<th class="quantity">
@T("Order.Shipments.Product(s).Quantity")
</th>
</tr>
</thead>
<tbody>
@foreach (var shipmentItem in shipment.ShipmentItems)
{
var orderItem = orderService.GetOrderItemById(shipmentItem.OrderItemId);
if (orderItem != null)
{
var productName = localizationService.GetLocalized(orderItem.Product, x => x.Name);
<tr>
@if (Model.ShowSku)
{
var sku = productService.FormatSku(orderItem.Product, orderItem.AttributesXml);
<td class="sku">
@sku
</td>
}
<td class="name">
<em><a href="@Url.RouteUrl("Product", new { SeName = urlRecordService.GetSeName(orderItem.Product) })">@productName</a></em>
@if (!string.IsNullOrEmpty(orderItem.AttributeDescription))
{
<div class="attributes">
@Html.Raw(orderItem.AttributeDescription)
</div>
}
</td>
<td class="quantity">
@orderItem.Quantity
</td>
<td class="quantity">
@shipmentItem.Quantity
</td>
</tr>
}
}
</tbody>
</table>
</td>
</tr>
}
//Custom END
Note: I didn't include rental info intentionally, if you need that also please let me know.
And included Qty Ordered.
Here is the outcome on order details page:
If you need the file "Presentation\Nop.Web\Views\Order\Details.cshtml" please find it here,
https://drive.google.com/file/d/1naKJaKhnlY2PmpQBqwkYqORKBQ5Hk4S2/view