Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Minor fix - admin panel - allow to delete item with gift voucher on the order, when gift voucher was deleted.

support6241b53c4fbd
diff --git a/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/DeleteOrderItemCommandHandler.cs b/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/DeleteOrderItemCommandHandler.cs
index 40e23d1fe..4494d522c 100644
--- a/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/DeleteOrderItemCommandHandler.cs
+++ b/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/DeleteOrderItemCommandHandler.cs
@@ -55,7 +55,9 @@ namespace Grand.Business.Checkout.Commands.Handlers.Orders
}
if (product.IsGiftVoucher)
{
- return (true, "You can't cancel gift voucher, please delete it.");
+ var giftVouchers = await _giftVoucherService.GetGiftVouchersByPurchasedWithOrderItemId(request.OrderItem.Id);
+ if(giftVouchers.Any())
+ return (true, "You can't delete item with gift voucher, first go to gift vouchers and delete it");
}
var shipments = await _shipmentService.GetShipmentsByOrder(request.Order.Id);