From f73c434ca8ff003819b1d1a4a6695705527528a5 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 25 Oct 2025 17:36:08 +0200 Subject: [PATCH] empty order fix --- .../Order/_CustomOrderDetails.Products.cshtml | 722 +++++++++--------- 1 file changed, 366 insertions(+), 356 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 fbdddec..3a583bd 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 @@ -4,271 +4,278 @@ @using Nop.Core.Domain.Catalog;
-
-
- @foreach (var item in Model.ItemExtendeds) - { - - } - - - - - @if (Model.HasDownloadableProducts) - { - - } - - - - - @if (!Model.IsLoggedInAsVendor) - { - - } - - -@* + } + } + } + + +
+
+
+ @{ + if (Model.ItemExtendeds != null) + { + foreach (var item in Model.ItemExtendeds) + { + + } + } + } + + + + @if (Model.HasDownloadableProducts) + { + + } + + + + + @if (!Model.IsLoggedInAsVendor) + { + + } + + + @* *@ - @if (Model.HasDownloadableProducts) - { - - } - - - - - - @* + @if (Model.HasDownloadableProducts) + { + + } + + + + + + @* *@ - - @if (!Model.IsLoggedInAsVendor) - { - - } - - - - @foreach (var item in Model.ItemExtendeds) - { - -@* + @if (!Model.IsLoggedInAsVendor) + { + + } + + + + @{ + if (Model.ItemExtendeds != null) + { + foreach (var item in Model.ItemExtendeds) + { + + @* *@ - @if (Model.HasDownloadableProducts) - { - + @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.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") -
+ + @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") - + @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") -
-
- -
-
- @*
+ } + 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")
@@ -277,44 +284,44 @@
*@ -
-
@(item.Quantity) kt.
-
-
-
- -
-
-
-
+
@(item.Quantity) kt.
+
+
+
+ +
+
+
+
-
- @($"{item.ProductStockQuantity} kt.")@($"{(item.ProductIncomingQuantity > 0 ? " (+" + item.ProductIncomingQuantity + ")" : string.Empty)}") -
-
+
+ @($"{item.ProductStockQuantity} kt.")@($"{(item.ProductIncomingQuantity > 0 ? " (+" + item.ProductIncomingQuantity + ")" : string.Empty)}") +
+
- @(item.NetWeight) kg. - - + @(item.NetWeight) kg. + + - @if(item.IsMeasurable) - { - Yes - } - else - { - No - } - - + @if (item.IsMeasurable) + { + Yes + } + else + { + No + } + + + @* @if (Model.AllowCustomersToSelectTaxDisplayType) {
@Html.Raw(item.DiscountInclTax)
@@ -357,41 +364,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")
@@ -399,56 +406,59 @@
*@ - -
- + + + - - + + - - + + - -
-
-
- @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