Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.

function observeCurrencySymbol() { const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (document.querySelector('.woocs_current_currency_symbol')) { observer.disconnect(); // Stop observing once the element is found convertBundlePrices(); // Run the conversion function } }); }); observer.observe(document.body, { childList: true, // Watch for added/removed elements subtree: true, // Watch entire DOM subtree }); } function convertBundlePrices() { const currencySymbolElement = document.querySelector('.woocs_current_currency_symbol'); if (!currencySymbolElement) { console.warn("Currency symbol element not found."); return; } const currencySymbol = currencySymbolElement.textContent; const exchangeRate = window.woocs_current_currency_rate || 1; document.querySelectorAll('.quantity-break').forEach((bundle) => { const regularPriceElement = bundle.querySelector('.bundle-cprice'); const salePriceElement = bundle.querySelector('.bundle-price'); if (!regularPriceElement || !salePriceElement) { console.warn("Missing price elements in bundle:", bundle); return; } const regularPrice = parseFloat(regularPriceElement.getAttribute('value')); const salePrice = parseFloat(salePriceElement.getAttribute('value')); if (isNaN(regularPrice) || isNaN(salePrice)) { console.warn("Invalid prices detected."); return; } const convertedRegularPrice = (regularPrice * exchangeRate).toFixed(2); const convertedSalePrice = (salePrice * exchangeRate).toFixed(2); regularPriceElement.textContent = `${currencySymbol}${convertedRegularPrice}`; salePriceElement.textContent = `${currencySymbol}${convertedSalePrice}`; }); } // Start observing for the currency symbol element observeCurrencySymbol(); // Re-run when currency updates document.addEventListener('woocs_updated', convertBundlePrices);
0
    0
    Your Cart
    Your cart is empty