document.addEventListener("DOMContentLoaded", function() {
const exchangeRate = 1.95583; // Курс болгарского лева к евро
const updatePrices = () => {
const priceElements = document.querySelectorAll(".ec-price"); // Элемент, где отображается цена
priceElements.forEach((el) => {
const priceText = el.textContent.trim();
const euroMatch = priceText.match(/(\d+[.,]?\d*)/);
if (euroMatch) {
const euro = parseFloat(euroMatch[1].replace(",", "."));
const bgn = (euro * exchangeRate).toFixed(2);
el.innerHTML = `${euro.toFixed(2)} €
≈ ${bgn} лв`;
}
});
};
updatePrices();
});