Developer forum

Forum » Development » creating new carts

creating new carts

Umar Farooq
Reply

I have a webservice where we are creating a cart and adding products. we recently updated the solution to 9.8.4 and old way of creating cart is depricated and now it requres to use oveload method with following parameters  Currency, Country, and Language 

When i try to get Currency it always has LanguageId set to Danish Language id which is default Langauge and due to this cart getting DKK prices instead of  EUR. and if i change the default language to german then prices on Dk site is EUR.

Is there something i am missing or there is otherway to get these values correctly

/umar

 


Replies

 
Nicolai Pedersen
Reply

Hi Umar

Just pass the currency, country and language you need.

Currency controls EUR vs DKK etc.
Country controls the VAT
Language controls - the language.

I do not understand you currency/language problem?

If you use Currency.LanguageID that is also deprecated - and you need to use GetTranslation. Currencies are not language managed except for the name.

Maybe show a bit of code.

Thanks, Nicolai

 
Umar Farooq
Reply

Hi Nicolai,

1- "Services.Carts.OrderLineBuilder"  is not to be found anywhere https://doc.dynamicweb.com/api/html/248061ab-032a-de4d-0fa8-b68f3f0a40a9.htm

2- I figured out after setting a cart to Context, Context Currency, Country and language was still set to Default Country and Currency. and due to this it was giving me wrong prices so i had set Context Currency, Country and language before setting a cart to context 

Common.Context.Currency = Currency;
Common.Context.Country = Country;
Common.Context.Language = Language;

Which fixed the issue.

 

/Umar

 

You must be logged in to post in the forum