Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Fetching carts from Commerce

$
0
0

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?


Viewing all articles
Browse latest Browse all 9076

Trending Articles