I am working on a solution with UCommerce with Sitecore 9.0.1.

I've followed the steps from here to do a FacetedQueryable https://docs.ucommerce.net/ucommerce/v8.1/getting-started/search-foundation/search-library.html

//Normal way of using queryable.
var query = SearchLibrary.FacetedQuery().Where(x => x.Variants.Any());

//adding facets to the query.
IList<Facet> facetsForQuery = GetSelectedFacets();

//Getting facets for the query.
IList<Facet> facets = query.ToFacets().ToList();

//Getting products for the query.
IList<Product> products = query.ToList();

And all looks good until one point, as looks like the search is not using Inventory On Hand for products or product variants.

Most of the products have variants and each variant has its own InventoryOnHand value. Is there a way to get in the search results only the products that have InventoryOnHand > 0 for their variants? And also to have the facets in the result to have the correct hits number?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.