WebSite X5Help Center

 
Yavor R.
Yavor R.
User

The possibility of displaying prices in two currencies  en

Author: Yavor R.
Visited 66, Followers 0, Shared 0  

Hello,
Is it possible to display prices (product, cart, order, invoice, etc.) in two currencies everywhere?

In connection with the introduction of the Euro as a currency in Bulgaria, there is a requirement for prices to be shown in BGN and € at the fixed exchange rate of 1.95583 BGN for 1 €. They must be in the same font and size. This requirement came into effect this week and will remain in force until 31 December 2026.

Thank you in advance!

Posted on the
4 ANSWERS - 1 USEFUL
Daniel W.
Daniel W.
User
Best User of the month DE

Maybe KolAsin (moderator) could provide an EXTRA code here, but he would need a link to the shop.

Read more
Posted on the from Daniel W.
Yavor R.
Yavor R.
User
Author

Thank you, Daniel!
We don’t have such a project online, but we are exploring the possibilities for our clients. We want to use WebSite X5 for them. At the moment, there is a working solution for OpenCart3, and the stores are running there.

My personal opinion is that you should add dual currency display in WebSite X5, because within the European Union, six member states have not yet adopted the euro and continue to use their own national currencies: the Czech Republic, Denmark, Hungary, Poland, Romania, and Sweden. Of these, all except Denmark are legally committed to adopting the euro once they meet the required convergence criteria. As I mentioned, Bulgaria will start using the euro from 01.01.2026.

Read more
Posted on the from Yavor R.
Axel  
Axel  
User
Best User of the month EN

Hello With the link posted by KolAsim wink I have this one by example

The code to add into the catalog page properties is here

And the full modified code is.


<script>
/** A script to display the price from ethe catalog page and to add another information price in other currency **/
/** The price into the cart will be ALWAYS in Euros in our case. Currency choosen during project creation **/
/** -- calcolo e aggiunta IVA x WSx5 by KolAsim -- **/


$(document).ready(function () {//K<;
setTimeout(() => {//K1>;
$('.im-cc-wrapper-row').each(function () {//K2>;
const rawPrice = $(this).text();
const priceCleaned = rawPrice.replace(/\s/g, '').replace('€', '');
const price = parseInt(priceCleaned);

if (isNaN(price)) return;

const changevalue = 0.51; // for the change value. . 0.51 is the actual value for change with bulgarian currency

const euros = Math.round(price); // Price in Euros
const lev = Math.round(price * changevalue); // Price in BGN for Bulgarian currency. 0.51 is the value for change

const formatEur = num => num.toLocaleString('fr-FR').replace(/\./g, ' ') + ' €';
const formatFt = num => num.toLocaleString('bg-BG').replace(/\./g, ' ') + ' лев';

// To display price infos in Euros & BGN
const ivaHtml = `
<div class="vat-calculation" style="font-weight:normal;font-size:12px">
Euros: <strong>${formatEur(euros)}</strong><br>
Info in Lev: <strong>${formatFt(lev)}</strong>
</div>`;

$(this).append(ivaHtml);

});//K2<<;
}, 800);//K1<<;
});//K<<;
</script>

Hope this helps...

Now you have the hand to modify it.

Axel

Read more
Posted on the from Axel