I was trying to fetch campaign prices for a product from a feed service, using IoC.Resolve< ICampaignPriceCalculator >().GetCampaignPrices(priceCalculatorArgs)
But I get an error always (something like, can’t fetch ordercarrier form user’s session) in response.
Litium version: [6]
It’s due of lack of session state when you use web api endpoints. It is possible to enable to have session also for web api’s.
To get ride of the problem you can set the CampaignPriceCalculatorArgs.OrderCarrier
to the users order carrier, if you wan’t the users order carrier be same between regular requests and web api requests you need to enable sessions for the web api.
1 Like