1. Home
  2. MINIMAL
  3. Extra
  4. Patch - bulk price symbols

Patch – bulk price symbols

add below JavaScript at Script Manager

<script>(function() {
    function startCurrencyFixer() {
        const targetNode = document.querySelector('.finalPrice');
        const priceSource = document.querySelector('.productView-price .price');

        // If elements aren't on the page yet, try again in 100ms
        if (!targetNode || !priceSource) {
            setTimeout(startCurrencyFixer, 100);
            return;
        }

        // 1. Get the correct symbol (e.g., £)
        const symbolMatch = priceSource.innerText.trim().match(/[^\d\s,.]/);
        const correctSymbol = symbolMatch ? symbolMatch[0] : '£';

        // 2. Watch for changes
        const observer = new MutationObserver((mutations) => {
            mutations.forEach((mutation) => {
                const currentText = targetNode.innerText;
                
                // If it contains $, swap it
                if (currentText.includes('$')) {
                    observer.disconnect(); // Stop watching briefly to avoid loop
                    targetNode.innerText = currentText.replace('$', correctSymbol);
                    observer.observe(targetNode, { childList: true, characterData: true, subtree: true });
                }
            });
        });

        observer.observe(targetNode, { childList: true, characterData: true, subtree: true });
    }

    // Start the process
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', startCurrencyFixer);
    } else {
        startCurrencyFixer();
    }
})();
</script>

How can we help?