Last active
November 24, 2020 18:02
-
-
Save timotheemoulin/2eb36acbdb82a9c0b0b0ce48d178030d to your computer and use it in GitHub Desktop.
woocommerce add space between currency and price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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