Filters not picking up products with prices from custom price calculator

We have a custom price calculator which works fine and shows correct prices in product feeds, product listings and other places.

However, the accelerator price filters don’t seem to recognize the custom prices. And after some testing it doesn’t seem the other filters see the products either.

When a custom-priced product is shown in a product listing, the filters don’t include a range for the custom price, and the sum of products for all filter ranges does not include the custom-priced products. So the only way to see the custom-priced products is to not select a price filter range.

The same seems true also for other filters like brand and color.

The only thing we have implemented to achieve the custom list pricing is a price decorator. We have made no modifications to the accelerator beyond that.

Litium version: 7.6.2 & accelerator

It has something to do with the indexing, do you use Elastic or Lucene?
Did you reindex all products?

Lucene, this is in dev with an OotB accelerator.

Yes, product index rebuilt. There are no errors or warnings in the log when rebuilding the product index. No crashes from the custom price calculator. The products with custom list price calculations are in the log like all others,

RebuildIndex, creating documents for product ‘07148655-…’ (54/100).

But surely it’s strange that the non-price filter criteria would also exclude the products? Perhaps the custom list price calculator is not the culprit, but something else. These products appear on category pages, in search and in feeds, but they don’t have list prices in price lists in Litium since all price calculation is custom. Perhaps the filter builder rejects these products for that reason?

Should I look in the index somehow to try to determine what the filter builder sees?

I think we need to do some preIndexing here, we’ll look into it and get back to you.

1 Like

All the prices that the variants have in different price lists are indexed. Since you do not have a price list it is not possible to filter the price correctly for those special prices. They are not in the search index. You have to put that one in the index by implementing IIndexingProviderPreProcessor. There are example of implementation of the interface in the accelerator, CampaignIndexingProviderPreProcessor for example.

Foreach variant having special price you have to add following tags for releated country/ies.

   var priceIncludingVatTagName = TagNames.GetTagNameForPriceIncludingVAT("a constant guid" for this type of prices, can be Guid.Empty, countryId);
   var priceExcludingVatTagName = TagNames.GetTagNameForPriceExludingVAT("a constant guid" for this type of prices, can be Guid.Empty, countryId);

   document.Tags.Add(new ReadableDocumentTag(priceExcludingVatTagName , priceExcludeVAT "that you have calculated for the variant") { TermVector = true });
   document.Tags.Add(new ReadableDocumentTag(priceIncludingVatTagName , priceIncludeVAT "that you have calculated for the variant") { TermVector = true });

Then you have to put “the constant guid” in the priceListSystemIds list in the Litium.Accelerator.Search.Filtering.PriceFilterService.AddPriceFilterTags metod.

Hope that it will solve the filter problem.

2 Likes

Thank you.

We’re having problems injecting services into the indexing provider pre-processor. As soon as we add any service that is reasonably complex, we get a “Scope cache was already disposed” error after a long startup time (fully reproducible). Are there any constraints on which services can be injected into indexing provider pre-processors?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.