X

How to Change the Currency Symbol in WooCommerce

Snippets by IsItWP

Are you looking for a way to change the currency symbol in WooCommerce? While there’s probably a plugin for this, we have created a quick code snippet that you can use to change the currency symbol in WooCommerce.

Instructions:

All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
  switch( $currency ) {
    case 'AUD': $currency_symbol = 'AUD$'; break;
  }
  return $currency_symbol;
} 

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 6 best Stripe payment plugins for WordPress and how to create a review site in WordPress.

Comments   Leave a Reply

  1. Hi, thank you! this works throughout the site but does not work when I receive new order emails, or customer receives the order confirmation email. The symbol is $ only in the emails. Do you know how to add it to the emails too?

  2. Vanusa Pedrozo March 7, 2019 at 2:40 pm

    I’m trying to replace the code symbol for Mexican pesos from $ to MXN $.

    I tried this snippet, but it didn’t work. Any thoughts?

    add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2);
    function change_existing_currency_symbol( $currency_symbol, $currency ) {
    switch( $currency ) {
    case ‘S’: $currency_symbol = ‘MXN $’; break;
    }
    return $currency_symbol;
    }

    I tried

  3. Thank you .. it worked

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!