Follow me on social media:

How To Change The Currency Symbol Of A Currency In WooCommerce (And Have It Still Work In PayPal)

WooCommerceA while back I had to deal with a requirement for an e-commerce website I was building for a customer that needed to have the currency code along with the currency symbol.

This was to avoid confusion with USD and AUD which both use the $ symbol.

To get past this we wanted to change the symbol to AUD$ instead of just $.

All the current work arounds that I could find would change it, but it would stuff up the payment as it went through to PayPal because it couldn’t find the proper currency code.

Here’s how to change the currency display symbol without changing the code or messing up the currency when it goes through to PayPal:

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

I originally posted this solution in the WordPress.org forums against this post because the OP had a very similar requirement. Hope this helps someone out there with a similar issue!

4 thoughts on “How To Change The Currency Symbol Of A Currency In WooCommerce (And Have It Still Work In PayPal)

  1. Thanks for this. If I wanted to do this for a number of currencies, do I simply remove the ~ break ~ code, and then add repetitions of the ~ case ‘AUD’: $currency_symbol = ‘AUD$’; ~ line, then add ~ break ~ to the last line. I am thinking along the right direction here?
    Thanks

  2. Okay. Further to last comment, I figured out I simply repeat that whole line as-is (including the ~ break; ~ at the end. Thanks for this tip.

  3. I want to change дин. into RSD but this code does not work for me

    add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2);

    function change_existing_currency_symbol( $currency_symbol, $currency ) {
    switch( $currency ) {
    case ‘дин.’: $currency_symbol = ‘RSD; break;
    }
    return $currency_symbol;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *