Skip to content

Instantly share code, notes, and snippets.

@softiconic
Last active December 2, 2023 19:00
Show Gist options
  • Save softiconic/060084a8bf52ee9d356acbfbee9d68bf to your computer and use it in GitHub Desktop.
Save softiconic/060084a8bf52ee9d356acbfbee9d68bf to your computer and use it in GitHub Desktop.
Alter the currency display in WooCommerce.
/**
* Change currency display in WooCommerce
* Put this in your functions.php file
*/
function softiconic_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'USD':
$currency_symbol = 'USD $';
break;
case 'CAD':
$currency_symbol = 'CAD $';
break;
}
return $currency_symbol;
}
add_filter('woocommerce_currency_symbol', 'softiconic_currency_symbol', 30, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment