Expand my Community achievements bar.

SOLVED

Replace currency symbol Server Side

Avatar

Level 2

Dear all,

how to replace currency symbol with another (e.g. $ symbol to £ symbol) via Target across the whole page?

With this I mean:

  • To replace any dollar symbol in a given page with the euro symbol, and
  • doing this preferably with Server Side implementation.

Is it possibile? Do I need to provide an mbox-id in advance for all lines where $ is displayed, or is there any other method?

Furthermore, is it possibile to achieve this via client-side?

 

Any help would be very appreciated.

Thanks

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

This should be relatively simple in a server-side implementation, the most simple option would be to create an activity that returns a JSON offer with something like....

{currency: "£"}

You would provide an mbox name as part of your server-side request to Target, and then your web application would parse the response and handle replacing all of the $ symbols. 

You could also achieve this client-side but the ease of implementation will depend a bit on how easy it is to identify all of the currency symbols on the page. For example, if all of your currency symbols have a class of "currency", then you could add a custom code modification in the Visual Editor, something like......

document.querySelectorAll('.currency').innerText = "£"

 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

This should be relatively simple in a server-side implementation, the most simple option would be to create an activity that returns a JSON offer with something like....

{currency: "£"}

You would provide an mbox name as part of your server-side request to Target, and then your web application would parse the response and handle replacing all of the $ symbols. 

You could also achieve this client-side but the ease of implementation will depend a bit on how easy it is to identify all of the currency symbols on the page. For example, if all of your currency symbols have a class of "currency", then you could add a custom code modification in the Visual Editor, something like......

document.querySelectorAll('.currency').innerText = "£"