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.

Recommended products - use in delete product handler

KrzysztofPajak043f55e3361c
diff --git a/src/Business/Grand.Business.Catalog/Events/Handlers/ProductDeletedEventHandler.cs b/src/Business/Grand.Business.Catalog/Events/Handlers/ProductDeletedEventHandler.cs
index f9653bc8c..039585cd1 100644
--- a/src/Business/Grand.Business.Catalog/Events/Handlers/ProductDeletedEventHandler.cs
+++ b/src/Business/Grand.Business.Catalog/Events/Handlers/ProductDeletedEventHandler.cs
@@ -55,6 +55,9 @@ namespace Grand.Business.Catalog.Events.Handlers
//delete cross sales product
await _productRepository.Pull(string.Empty, x => x.CrossSellProduct, notification.Entity.Id, true);
+ //delete recomended product
+ await _productRepository.Pull(string.Empty, x => x.RecommendedProduct, notification.Entity.Id, true);
+
//delete review
await _productReviewRepository.DeleteManyAsync(x=>x.ProductId == notification.Entity.Id);