Changing a user locale (currency) programmatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 09:10 AM
Hello Gurus,
I have a requirement to change a user currency within an existing session without having to log out.
Currently, when i change a country code on a user profile and refresh the entire site/page, no change takes place meaning that I see catalog item prices in the same currency, though technically prices should be shown in a new currency -> I suppose a session object does not notice of this change ?.
However, when i log out and log back in, the system shows prices in a correct currency...
with that said, is there a way to accomplish the above without having to log out??
Many thanks
Cheers
Maros
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 11:22 PM
Hey Maros,
As rightly observed by you the changes in the country code would do the trick. But here the catch is the user session that still prevails when a user refreshes his/her page.
Therefore, in order to apply the changes in the instance and breakdown the user session one must need to log out.
Please Hit ✅Correct, âÂ��Helpful, or ��Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 12:52 AM
Hello Divya,
thank you for your comment.
I am looking for a setter method on the session object, which will allow me to overwrite an existing locale setting, mainly a country code as that determines what currency is used to display prices.
Cheers
Maros