Last active
May 14, 2021 05:56
-
-
Save wbcomdev/c47ee488496bd48ed0a07e1f3b097a69 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * Add Custom currency name and currency symbol. | |
| */ | |
| function wb_add_my_currency( $currencies ) { | |
| $currencies['ABC'] = __( 'Currency name', 'woocommerce' ); | |
| return $currencies; | |
| } | |
| add_filter( 'woocommerce_currencies', 'wb_add_my_currency' ); | |
| /** | |
| * Add Custom currency symbol. | |
| */ | |
| function wb_add_my_currency_symbol( $currency_symbol, $currency ) { | |
| switch ( $currency ) { | |
| case 'ABC': | |
| $currency_symbol = '$'; | |
| break; | |
| } | |
| return $currency_symbol; | |
| } | |
| add_filter( 'woocommerce_currency_symbol', 'wb_add_my_currency_symbol', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment