Posted on 15/09/2017 11:02:01
Hi Søren
Product.Price.Price calls prices providers and discounts and you are lacking a ton of context which is not available in the thread executing the indexing. There are 2 issues - missing Dynamicweb context and missing httpcontext (probably).
Much of Dynamicweb is no longer depending on httpcontext, but Ecommerce still does to some extend - we are working on that.
First thing you could try was to create a pageview instance in the indexer. That will give you some context, but might give you issues with missing httpcontext. You might be able to find a way to add a httpcontext to the thread, but it is really difficult.
Most discounts are order discounts - so you might need to just find product discounts and do the math your self.
We have looked into this as well - and I see no good way to do this - and the result will be almost as useles as not doing this...
BR Nicolai