We have extended our search a bit from the Accelerator. We added this to exclude products that are discontinued and have a stock of 0.
var excludeTags = new ExcludeTagClause(); request.FilterTags.Add(excludeTags); var excludeDiscontinuedTags = new MandatoryTagClause(); excludeDiscontinuedTags.Tags.Add(new Tag(TagNames.GetTagNameForWarehouseQuantity(CurrentState.Current.WebSite.InventoryId), 0)); excludeDiscontinuedTags.Tags.Add(new Tag(_fieldDefinitionService.Get("Discontinued").GetTagName(), true)); excludeTags.Tags.Add(excludeDiscontinuedTags);
But then we have some products with many variants, and if one is discountinued and have a stock of 0 we get 0 results in the search cause of 1 variant.
How do I write so the result still gets a hit?
Litium version: 6.2.2