Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I think it was an overlook (aka a bug). I will file a bug to commerce team. thanks for bringing this into our attention
@Christian, good catch. The only solution I see until the bug is resolved is create an override of DefaultOrderSearchAsyncService or replace custom implementation of IOrderSearchAsyncService and copy the existing implementation code and adjust it to your need. Or else you can try adding a code interception.
Given the following interface from optimizely:
namespace EPiServer.Commerce.Order { /// <summary>Filter class used to filter which orders to retrieve.</summary> public class OrderSearchFilter { ... /// <summary> /// Specifies that only carts/orders created by specified customer should be returned. /// </summary> public Guid CustomerId { get; set; } ... } }
I would expect it to be possible to search for carts in the the order repository using IOrderSearchAsyncService by doing the following:
var searchFilter = new OrderSearchFilter{CustomerId = currentCustomer.OrganizationId}; var searchResults = await orderSearchAsyncService.SearchAsync<ICart>(null, searchFilter, default);
The observed result is that all carts are returned, regardless of their CustomerId being different.
Is this the intended behaviour?