I want to replace the comma in the price with the currency symbol to display something like this .
1 Answer
I have below a javascript solution that may help you. It will only work with currency where the currency code is before the value. I have it working on my local environment so it should definitely push you a bit further.
define([
'jquery'
], function ($) {
$('.price').each(function (index, elt) {
var price = $(elt).html();
var currency = price.substring(0,1);
var value = price.substring(1);
$(elt).html(value.replace('.', '<sup>'+currency+'</sup>'));
});
}