<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
});

Sample Page

This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:

Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)

…or something like this:

The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.

As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!