Replace currency symbol Server Side | Community
Skip to main content
FraCalzo
Level 2
December 19, 2022
Solved

Replace currency symbol Server Side

  • December 19, 2022
  • 1 reply
  • 760 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by alexbishop

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 = "£"

 

1 reply

alexbishop
Adobe Employee
alexbishopAdobe EmployeeAccepted solution
Adobe Employee
July 25, 2023

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 = "£"