Change WooCommerce currency from Euro to Dollar

Avatar
  • updated
  • Answered

I`m a beginner, I choose a eCommerce theme from WooCommerce that the price is set to Euro, I want to change it to Dollar.

Avatar
JacobIMH
Hello Taking a look at the documentation from WooThemes on how to add a custom currency symbol, it looks like you should be able to change this to US dollars. I believe your code would be:
add_filter( 'woocommerce_currencies', 'add_my_currency' );
 
function add_my_currency( $currencies ) {
     $currencies['USD'] = __( 'US Dollars', 'woocommerce' );
     return $currencies;
}
 
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
 
function add_my_currency_symbol( $currency_symbol, $currency ) {
     switch( $currency ) {
          case 'USD': $currency_symbol = '$'; break;
     }
     return $currency_symbol;
}
Please let us know if that works for you, or if you had any other questions at all. - Jacob