Developer forum

Forum » Templates » Changing currencies on the fly

Changing currencies on the fly

Nikki Strømsnes
Reply
I'm working on an international eComm solution, and the client would of course let the user change currency. What I did, was to create a select with all the available currencies, and bind a function to an onchange event, which passed the value in a "CurrencyCode=XXX" parameter. This is all well and good, but naturally it reloads the page, which the client is not very happy about.

Now, the question is, whether or not it's possible to extract the price in all available currencies in some strange loop, so that I can simply display the price in the different currencies, without going through the server every time. I can't find any info on it, but it actually worked somehow on their old solution, which I sadly don't have access to, but it looks like some sort of hack.

Does that make sense at all?

Replies

 
Morten Bengtson
Reply
Sounds very familiar ;-)

There are no standard template tags for displaying prices in multiple currencies, AFAIK. Maybe it is possible in DW8, but I haven't looked into that.

I once implemented a ProductTemplateExtender for displaying prices in different currencies. I guess you can call it a hack :)
You can see it in action here:  http://www.skagerak-denmark.com/Default.aspx?ID=462&ProductID=PROD8112&VariantID=VO302&GroupID=GROUP245 (the front end implementation is not my work).

BR.
Morten
 
Nikki Strømsnes
Reply
This post has been marked as an answer
Haha, yes, that's exactly what I want.

I simply solved it by refreshing the price with an AJAX-request to a page with the corresponding currency code.
Votes for this answer: 0

 

You must be logged in to post in the forum