Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I was working on a project with multiple cultures and countries, When I tried to switch culture from da-DK to en-US all the Prices, Currencies, and VAT of the cart items must be changed from DKK to USD which is set in the backend.
But I can see that all of the properties didn't switch properly.
I can see the VAT rate changed from 25,00% (of da-DK) to 20.00% (en-US) but is displaying in a danish culture 20,00
Could you please help?
Can you share what code you are currently using to "switch the culture"? I should be able to suggest something once I know what you are currently doing.
I'm not sure.
Can you please share which are codes used in Tea Commerce to switch currency and culture?
To set the current sessions currency you would use
See https://docs.teacommerce.net/3.4.0/api/currency/#getcurrentcurrency for more details.
We don't control the session culture change, hence why I asked what code you were using so I could suggest how to integrate the code above.
Do this code affect culture for items in the order?
No, those are essentially setting the billing / shipping address regions of your order. They have no effect on the order culture.
You can change an individual orders currency by calling
I believe this should then force the prices to recalculate when the order is saved.
PS TC.SetCurrentCurrency(storeId, currencyId); will call order.ChangeCurrency(currencyId) under the hood. The difference is, TC.SetCurrentCurrency will set the current session currency, so any new orders created will automatically be in that currency from that moment on, where as order.ChangeCurrency only changes the currency of that one order with the currency sessions default currency being unchanged.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted