Sometimes customer want to place links for currencies changing into his site header.php. Or something another... But if to place link simply as: <a href="/?currency=USD">USD</a> - it will redirect user to the main page - what is not convenient. In such case JavaScript can help you!
Drop links with the currencies you need into the place you are need (header.php), example:
<a href="#" data-currency="USD" class="woocs_currency_link">USD</a> <a href="#" data-currency="EUR" class="woocs_currency_link">EUR</a> <a href="#" data-currency="GBP" class="woocs_currency_link">GBP</a>
Somewhere in your theme.js or in the footer.php drop the next js code:
Shortcodes, functions, actions and filters reference for FOX WooCommerce Currency Switcher
Codex — FOX Currency Switcher
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.