We need to calculate the price (list & campaign) for a variant in a scheduled task, but the ProductPriceModelBuilder throws an exception because it “Cant fetch OrderCarrier from users session” (sic) which sounds like it needs a user context.
Is there a way to use the ProductPriceModelBuilder without a user context, e.g., from a scheduled task?
Or is there something other than the ProductPriceModelBuilder that can calculate the list & campaign price for a variant with a user context?
We have tried to use the ICampaignPriceCalculator (this is Litium 7), but it doesn’t seem to be able to calculate any campaign prices. The list of campaign prices it calculates is always empty.
We are using the accelerator ICampaignPriceCalculator implementation.
Pass in the OrderCarrier in the CampaignPriceCalculatorArgs.OrderCarrier, if that is null the system tries to resolve the OrderCarrier from the user http session.
However, campaignPriceResults is always empty when we do this.
We have double-checked that all the calculator arguments are correct, and that product pages on the site show campaign prices.
We have created campaigns that apply to all channels and all currencies just for testing, but regardless, there are never any campaign price results returned.