Developer forum

Forum » Development » Webapi: Support for country in prices

Webapi: Support for country in prices

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

When calling this endpoint: "/dwapi/ecommerce/products/{id}" we can specify the country, but this country is not set in: Common.Context.Country, which means that the prices does not take the country into account when calculating a price.

Can this be added? And also make it possible to fetch the country in a custom priceprovider.

 

Best regards,

Anders


Replies

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

You can use  >>  new Product().GetPrice(CurrencyCode, CountryCode) in the api to get product price base on currency and country.

in the custom price provider try to create a scenario using HttpContext.Current.Session

 

 
Nicolai Pedersen
Reply

Hi Shiwanka

Thank you for your input!

In the webapi no session state is available, so working with session will not work.

The above turned out to be a problem with context in our price manager that we have temporarily solved in 9.10 and in 9.12 there will be a refactor of the callstackt to send down the correct country from webapi and the catalog frontend respectively.

BR Nicolai

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Ohh yes Nicolai, thanks for correcting it. i miss the api part

 

 

 

You must be logged in to post in the forum