diff --git a/Directory.Build.props b/Directory.Build.props index f7d9426f..5cf8ce14 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ - 3.831.0 + 3.832.0 $(VersionSuffix)-$(BuildNumber) diff --git a/src/VirtoCommerce.OrdersModule.Core/Model/Search/CustomerOrderSearchCriteria.cs b/src/VirtoCommerce.OrdersModule.Core/Model/Search/CustomerOrderSearchCriteria.cs index 9c9624e4..b2527125 100644 --- a/src/VirtoCommerce.OrdersModule.Core/Model/Search/CustomerOrderSearchCriteria.cs +++ b/src/VirtoCommerce.OrdersModule.Core/Model/Search/CustomerOrderSearchCriteria.cs @@ -84,5 +84,10 @@ public string[] OrganizationIds _organizationIds = value; } } + + /// + /// Search orders with a certain product + /// + public string ProductId { get; set; } } } diff --git a/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderSearchService.cs b/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderSearchService.cs index b47b5a39..87e7aa05 100644 --- a/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderSearchService.cs +++ b/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderSearchService.cs @@ -71,6 +71,11 @@ protected override IQueryable BuildQuery(IRepository reposi query = WithSubscriptionConditions(query, criteria); + if (!string.IsNullOrEmpty(criteria.ProductId)) + { + query = query.Where(o => o.Items.Any(i => i.ProductId == criteria.ProductId)); + } + return query; } diff --git a/src/VirtoCommerce.OrdersModule.Web/module.manifest b/src/VirtoCommerce.OrdersModule.Web/module.manifest index ea8d34f3..3cc0f016 100644 --- a/src/VirtoCommerce.OrdersModule.Web/module.manifest +++ b/src/VirtoCommerce.OrdersModule.Web/module.manifest @@ -1,7 +1,7 @@ VirtoCommerce.Orders - 3.831.0 + 3.832.0 3.853.0