(function () {
function updateEstoValues() {
const priceEl = document.querySelector('.woocommerce-Price-amount bdi');
if (!priceEl) return;
let raw = priceEl.innerText || '';
raw = raw.replace(',', '.').replace(/[^\d.]/g, '');
const price = parseFloat(raw);
if (isNaN(price)) return;
const split = (price / 3).toFixed(2);
const monthly = (price / 29).toFixed(2);
const splitEl = document.getElementById('esto-split');
const monthlyEl = document.getElementById('esto-monthly');
if (splitEl) splitEl.textContent = split;
if (monthlyEl) monthlyEl.textContent = monthly;
console.log('✅ ESTO: Kaina €' + price + ', 3 dalys: €' + split + ', mėn.: €' + monthly);
}
let attempts = 0;
const maxAttempts = 10;
const interval = setInterval(() => {
const priceEl = document.querySelector('.woocommerce-Price-amount bdi');
if (priceEl) {
updateEstoValues();
clearInterval(interval);
} else if (++attempts >= maxAttempts) {
clearInterval(interval);
console.warn('❌ ESTO: Nepavyko rasti kainos DOM\'e.');
}
}, 300);
})();
Mes naudojame slapukus, kurie užtikrina, kad Jums bus patogu naudotis tinklalapiu. Jei toliau naršysite mūsų tinklalapyje, tai tolygu Jūsų sutikimui su slapukų naudojimu.