<div class="currency-switcher">
  <select id="currency-select">
    <option value="USD">USD</option>
    <option value="PKR">PKR</option>
  </select>
</div>
  
  
select {
    background-size: 4px 4px, 4px 4px;
    border-radius: 4px;
}
document.addEventListener('DOMContentLoaded', function() {
    const currencySelect = document.getElementById('currency-select');
    
    // Conversion rates (you can update this based on your latest rates)
    const conversionRates = {
        USD: 1,       // Base currency
        PKR: 285,     // Conversion rate from USD to PKR (example)
    };

    // Function to update prices
    function updatePrices(currency) {
        const elements = document.querySelectorAll('.woocommerce-Price-amount, p, label, .options-wrapper li label, .brxe-ltoycd brxe-text-basic');

        elements.forEach(element => {
            let priceText = element.innerText || element.textContent;

            // Skip non-price elements like "25% OFF"
            if (priceText.includes('% OFF')) return;

            // Match prices with currency symbols or numbers
            let matches = priceText.match(/(\$|€|₹|\d+(\.\d{1,2})?)/g);  // Match currency symbols and prices
            
            if (matches) {
                matches.forEach(match => {
                    // Remove the currency symbol and parse the number
                    let price = parseFloat(match.replace(/[^\d.-]/g, ''));

                    // If a valid price is found
                    if (!isNaN(price)) {
                        // Convert the price
                        let convertedPrice = price * conversionRates[currency];

                        // Format the price back with the appropriate currency symbol
                        let formattedPrice;
                        if (currency === 'USD') {
                            formattedPrice = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(convertedPrice);
                        } else if (currency === 'PKR') {
                            formattedPrice = `PKR ${new Intl.NumberFormat('en-IN').format(convertedPrice)}`; // Use Indian locale for PKR formatting
                        }

                        // Remove the existing currency symbol to avoid duplication
                        element.innerHTML = element.innerHTML.replace(match, formattedPrice);
                    }
                });
            }
        });
    }

    // Reload page when the currency changes
    currencySelect.addEventListener('change', function() {
        let selectedCurrency = currencySelect.value;
        localStorage.setItem('selectedCurrency', selectedCurrency); // Store the selected currency

        // Reload the page to properly reapply the conversion with the selected currency
        window.location.reload();
    });

    // Load the currency from localStorage
    const storedCurrency = localStorage.getItem('selectedCurrency') || 'USD';
    currencySelect.value = storedCurrency;
    updatePrices(storedCurrency);  // Apply the selected currency after reload
});

Pakistan's Best Web Hosting

With fast and friendly support

Fast Google Cloud servers combined with cPanel, affordable prices, and superfast technical support. Don’t settle for less, settle for SpeedHost only.

See our plans

Best Hosting Plans

Fast Google Cloud servers combined with cPanel, affordable prices, and superfast technical support. Don’t settle for less, settle for SpeedHost only.

Pakistan's Best Web Hosting

With fast and friendly support

Fast Cloud servers combined with cPanel, affordable prices, and superfast technical support. Don’t settle for less, settle for SpeedHost only. Deploy your web applications, especially WordPress, Laravel & Python, etc in just few clicks.

🎁

25% FLAT OFF on all Web Hosting plans*

Pakistan's Best Web Hosting

With fast and friendly support

Fast Google Cloud servers combined with cPanel, affordable prices, and superfast technical support. Don’t settle for less, settle for SpeedHost only.

See our plans

More Performance, Less Worry, affordable prices

Our Hosting Plans

Need Even More?

Try Our Customized Package

Discover hosting plans made to help you. Combine the flexibility of Power with smart tools to build and manage a successful business. Specifically designed for WordPress websites, these hosting plans offer you extra power, trusted website uptime and the ability to handle steady or sudden growth.

Get Started

Compare Plans

All our hosting plans include

Speed

20x faster speeds with double the resources, fast NVMe-based cloud storage, and enterprise Litespeed features. Your website flies with our hosting.

  • High-performance Litespeed Enterprise Servers
  • NVME cloud storage
  • HTTP/s and QUIC-enabled emails with spam filtering 
  • WordPress Auto installer

Security

Feel safe with unlimited free SSL certificates, twice daily offsite backups, immunify360 malware protection, firewall, and spam protection.

  • PCI-DSS complaint
  • FREE SSL certificates
  • Private Account Environment
  • Web Application Firewall
  • DDOS protection
  • Immunify 360 Malware Protection

Reliability

Tap into our experienced support staff whenever you need.

  • 99.9% uptime guaranteed
  • Multiple-level support system (Email, Phone, Whatsapp, FB)
  • Daily Automatic offsite backups

Support

Tap into our experienced support staff whenever you need.

  • High-performance Litespeed Enterprise Servers
  • NVME cloud storage
  • HTTP/s and QUIC-enabled emails with spam filtering 
  • WordPress Auto installer

Backup

Tap into our experienced support staff whenever you need.

  • 99.9% uptime guaranteed
  • Multiple-level support system (Email, Phone, Whatsapp, FB)
  • Daily Automatic offsite backups

Start your hosting for free now

Fill in the hosting form and submit it for review, We will configure your hosting account free for 7 days

Start your free trial now

FAQs