From 6d2e7df65f867d7ee6acbf52a63b5cc652a1797a Mon Sep 17 00:00:00 2001 From: Loretta Date: Sat, 25 Oct 2025 09:11:06 +0200 Subject: [PATCH] _CustomOrderDetails.Products javascript improvements, fixes --- .../Order/_CustomOrderDetails.Products.cshtml | 744 +++++++++--------- 1 file changed, 381 insertions(+), 363 deletions(-) diff --git a/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Views/Order/_CustomOrderDetails.Products.cshtml b/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Views/Order/_CustomOrderDetails.Products.cshtml index dc76b63..bfa8684 100644 --- a/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Views/Order/_CustomOrderDetails.Products.cshtml +++ b/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Views/Order/_CustomOrderDetails.Products.cshtml @@ -3,265 +3,272 @@ @using Nop.Core.Domain.Tax; @using Nop.Core.Domain.Catalog; + +
-
-
- @foreach (var item in Model.Items) - { - +
+
+ @foreach (var item in Model.ItemExtendeds) + { + + } - - } - - - - - @if (Model.HasDownloadableProducts) - { - - } - - - - - @if (!Model.IsLoggedInAsVendor) - { - - } - - - - - @if (Model.HasDownloadableProducts) - { - - } - - - - - - @* + } + +
- @T("Admin.Orders.Products.Picture") - - @T("Admin.Orders.Products.ProductName") - - @T("Admin.Orders.Products.Download") - - @T("Admin.Orders.Products.Price") - - @T("FruitBank.IsMeasurable") - - @T("FruitBank.StockQuantity") - - @T("Admin.Orders.Products.Quantity") - - @T("FruitBank.NetWeight") - + + + + @if (Model.HasDownloadableProducts) + { + + } + + + + + @if (!Model.IsLoggedInAsVendor) + { + + } + + +@* + *@ + @if (Model.HasDownloadableProducts) + { + + } + + + + + + @* *@ - - @if (!Model.IsLoggedInAsVendor) - { - - } - - - - @foreach (var item in Model.ItemExtendeds) - { - - - - @if (Model.HasDownloadableProducts) - { - - } - + @if (!Model.IsLoggedInAsVendor) + { + + } + + + + @foreach (var item in Model.ItemExtendeds) + { + +@* + *@ + @if (Model.HasDownloadableProducts) + { + + } + - - + - + - - - + - @* + + + + @* *@ - - @if (!Model.IsLoggedInAsVendor) - { - + @if (!Model.IsLoggedInAsVendor) + { + - } - - } - -
+ @T("Admin.Orders.Products.Picture") + + @T("Admin.Orders.Products.ProductName") + + @T("Admin.Orders.Products.Download") + + @T("Admin.Orders.Products.Price") + + @T("Admin.Orders.Products.Quantity") + + @T("FruitBank.StockQuantity") + + @T("FruitBank.NetWeight") + + @T("FruitBank.IsMeasurable") + @T("Admin.Orders.Products.Discount") - @T("Admin.Orders.Products.Total") - - @T("Admin.Common.Edit") -
- - - @item.ProductName - @if (!string.IsNullOrEmpty(item.AttributeInfo)) - { -

- @Html.Raw(item.AttributeInfo) -

- } - @if (!string.IsNullOrEmpty(item.RecurringInfo)) - { -

- @Html.Raw(item.RecurringInfo) -

- } - @if (!string.IsNullOrEmpty(item.RentalInfo)) - { -

- @Html.Raw(item.RentalInfo) -

- } - @if (!string.IsNullOrEmpty(item.Sku)) - { -

- @T("Admin.Orders.Products.SKU"): - @item.Sku -

- } - @if (!string.IsNullOrEmpty(item.VendorName)) - { -

- @T("Admin.Orders.Products.Vendor"): - @item.VendorName -

- } - @if (item.ReturnRequests.Count > 0) - { -

- @T("Admin.Orders.Products.ReturnRequests"): - @for (var i = 0; i < item.ReturnRequests.Count; i++) - { - var returnRequest = item.ReturnRequests[i]; - @returnRequest.CustomNumber - if (i != item.ReturnRequests.Count - 1) - { - , - } - } -

- } -
- @if (item.IsDownload) - { - - @T("Admin.Orders.Products.Download.Download") - - - } - else - { - @T("Admin.Orders.Products.Download.NotAvailable") - } - - @if (Model.AllowCustomersToSelectTaxDisplayType) - { -
@Html.Raw(item.UnitPriceInclTax)
-
@Html.Raw(item.UnitPriceExclTax)
- } - else - { - switch (Model.TaxDisplayType) - { - case TaxDisplayType.ExcludingTax: - { - @Html.Raw(item.UnitPriceExclTax) - } - break; - case TaxDisplayType.IncludingTax: - { - @Html.Raw(item.UnitPriceInclTax) - } - break; - default: - break; - } - } -
-
-
- @T("Admin.Orders.Products.Edit.InclTax") -
-
- -
-
-@*
+
+ @T("Admin.Orders.Products.Total") + + @T("Admin.Common.Edit") +
+ + + @item.ProductName + @if (!string.IsNullOrEmpty(item.AttributeInfo)) + { +

+ @Html.Raw(item.AttributeInfo) +

+ } + @if (!string.IsNullOrEmpty(item.RecurringInfo)) + { +

+ @Html.Raw(item.RecurringInfo) +

+ } + @if (!string.IsNullOrEmpty(item.RentalInfo)) + { +

+ @Html.Raw(item.RentalInfo) +

+ } + @if (!string.IsNullOrEmpty(item.Sku)) + { +

+ @T("Admin.Orders.Products.SKU"): + @item.Sku +

+ } + @if (!string.IsNullOrEmpty(item.VendorName)) + { +

+ @T("Admin.Orders.Products.Vendor"): + @item.VendorName +

+ } + @if (item.ReturnRequests.Count > 0) + { +

+ @T("Admin.Orders.Products.ReturnRequests"): + @for (var i = 0; i < item.ReturnRequests.Count; i++) + { + var returnRequest = item.ReturnRequests[i]; + @returnRequest.CustomNumber + if (i != item.ReturnRequests.Count - 1) + { + , + } + } +

+ } +
+ @if (item.IsDownload) + { + + @T("Admin.Orders.Products.Download.Download") + + + } + else + { + @T("Admin.Orders.Products.Download.NotAvailable") + } + + @if (Model.AllowCustomersToSelectTaxDisplayType) + { +
@Html.Raw(item.UnitPriceInclTax)
+
@Html.Raw(item.UnitPriceExclTax)
+ } + else + { + switch (Model.TaxDisplayType) + { + case TaxDisplayType.ExcludingTax: + { + @Html.Raw(item.UnitPriceExclTax) + } + break; + case TaxDisplayType.IncludingTax: + { + @Html.Raw(item.UnitPriceInclTax) + } + break; + default: + break; + } + } +
+
+
+ @T("Admin.Orders.Products.Edit.InclTax") +
+
+ +
+
+ @*
@T("Admin.Orders.Products.Edit.ExclTax")
@@ -270,34 +277,44 @@
*@ -
-
-
-
@($"{item.ProductStockQuantity}{(item.ProductIncomingQuantity > 0 ? " (+"+item.ProductIncomingQuantity + ")" : string.Empty)}")
-
+
@(item.Quantity) kt.
+
+
+
+ +
+
+
+
-
@item.Quantity
-
-
-
- -
-
-
-
- @*
@item.NetWeight
*@ -
-
+
+ @($"{item.ProductStockQuantity} kt.")@($"{(item.ProductIncomingQuantity > 0 ? " (+" + item.ProductIncomingQuantity + ")" : string.Empty)}") +
+
+ + @(item.NetWeight) kg. + + + @if(item.IsMeasurable) + { + Yes + } + else + { + No + } + + @if (Model.AllowCustomersToSelectTaxDisplayType) {
@Html.Raw(item.DiscountInclTax)
@@ -340,40 +357,41 @@
- @if (Model.AllowCustomersToSelectTaxDisplayType) - { -
@Html.Raw(item.SubTotalInclTax)
-
@Html.Raw(item.SubTotalExclTax)
- } - else - { - switch (Model.TaxDisplayType) - { - case TaxDisplayType.ExcludingTax: - { - @Html.Raw(item.SubTotalExclTax) - } - break; - case TaxDisplayType.IncludingTax: - { - @Html.Raw(item.SubTotalInclTax) - } - break; - default: - break; - } - } -
-
-
- @T("Admin.Orders.Products.Edit.InclTax") -
-
- -
-
-@*
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType) + { +
@Html.Raw(item.SubTotalInclTax)
+
@Html.Raw(item.SubTotalExclTax)
+ } + else + { + switch (Model.TaxDisplayType) + { + case TaxDisplayType.ExcludingTax: + { + @Html.Raw(item.SubTotalExclTax) + } + break; + case TaxDisplayType.IncludingTax: + { + @Html.Raw(item.SubTotalInclTax) + } + break; + default: + break; + } + } +
+
+
+ @T("Admin.Orders.Products.Edit.InclTax") +
+
+ +
+
+ @*
@T("Admin.Orders.Products.Edit.ExclTax")
@@ -381,56 +399,56 @@
*@ - -
- + + + - - + + - - + + - -
- - - @if (!string.IsNullOrEmpty(Model.CheckoutAttributeInfo) && !Model.IsLoggedInAsVendor) - { -
-
- @Html.Raw(Model.CheckoutAttributeInfo) -
-
- } - @if (!Model.IsLoggedInAsVendor) - { -
-
- -
-
- } + + + } +
+
+
+ @if (!string.IsNullOrEmpty(Model.CheckoutAttributeInfo) && !Model.IsLoggedInAsVendor) + { +
+
+ @Html.Raw(Model.CheckoutAttributeInfo) +
+
+ } + @if (!Model.IsLoggedInAsVendor) + { +
+
+ +
+
+ }
\ No newline at end of file