Skip to content

Instantly share code, notes, and snippets.

@timotheemoulin
Last active November 24, 2020 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timotheemoulin/2eb36acbdb82a9c0b0b0ce48d178030d to your computer and use it in GitHub Desktop.
Save timotheemoulin/2eb36acbdb82a9c0b0b0ce48d178030d to your computer and use it in GitHub Desktop.
woocommerce add space between currency and price
<?php
/**
* Add a spcae after the CHF currency in WooCommerce.
*
* @param string $currency_symbol
* @param string $currency
*
* @return string
*/
function timwp_woocommerce_add_space_currency( string $currency_symbol, string $currency ): string {
if ( 'CHF' == $currency ) {
$currency_symbol = 'CHF ';
}
return $currency_symbol;
}
add_filter( 'woocommerce_currency_symbol', 'timwp_woocommerce_add_space_currency', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment