Copy link to clipboard
Copied
Hello,
Can you please guide me how to add space between currency symbol and price?
Support told me to ask this in forums because it is done with JavaScript and it is not covered in official documentation.
Anyone have done this? I would like to transform RON13,20 in 13,20 RON or USD32,90 in 32,90 USD.
Thanks!
Hello.
I test it and it is working.
If anybody need it this is how i did it.
I modified Modules Templates-> Online Shop Layouts -> Overall Layout.
I added at the end of the HTML code the following JS code:
<script type="text/javascript">
$(document).ready(function(){
$('.newprice').each(function(i, el){
var valoare = $(this).html().substr(10);
$(this).html('<div class="pret_ron">Pret: ' + valoare + ' RON</div>')
})
$('.oldprice').each(function(i, el){
var valoare = $(this).html().substr(3);
if($(this).html(
...Copy link to clipboard
Copied
Hi Bogdan,
I did some testing in in Chrome console quickly and I think you can use this approach:
var price = "RON12.40"
var altered = price.substr(3);
altered
"12.40"
var new_price = altered+" RON"
new_price
"12.40 RON"
That will convert the price format to Romanian format. All you need to do is add some jQuery that will grab the price of each product and apply this code to it.
This is the link that will take you through it http://api.jquery.com/each/
Cheers,
-mario
Copy link to clipboard
Copied
Hello,
Thank you for reply Mario.
I will test it and let you know how it worked.
Copy link to clipboard
Copied
Hello.
I test it and it is working.
If anybody need it this is how i did it.
I modified Modules Templates-> Online Shop Layouts -> Overall Layout.
I added at the end of the HTML code the following JS code:
<script type="text/javascript">
$(document).ready(function(){
$('.newprice').each(function(i, el){
var valoare = $(this).html().substr(10);
$(this).html('<div class="pret_ron">Pret: ' + valoare + ' RON</div>')
})
$('.oldprice').each(function(i, el){
var valoare = $(this).html().substr(3);
if($(this).html() != ''){ $(this).html(valoare + " RON") }
})
})
</script>
The result can be seen here: http://magazindepiese.worldsecuresystems.com/accesorii/chimice?Page=1&Items=12
Instead of PRICE: RON22,62 now it is PRET: 22,62 RON which is correct for Romania.
Thanks Mario!
Copy link to clipboard
Copied
Thanks for sharing that solution with our community, Bogdan!
Copy link to clipboard
Copied
With pleasure
Copy link to clipboard
Copied
Thanks Bogdan and Mario,
I use this solution for my productlist on this page: http://hafenmannheim.businesscatalyst.com/shop
It works great. One question: How can I change the price in the module shoppingcartsummary?
Any suggestions?
cheers, wallibert
Find more inspiration, events, and resources on the new Adobe Community
Explore Now