WooCommerce 添加自定义货币/符号,将 PHP 代码放在主题或子主题 functions.php 文件的底部。
- add_filter( 'woocommerce_currencies', 'add_my_c4 F Nurrency' );
- function add_my_currency( $currencies ) {
- $c= # F _ |urr` r ? p I r ^ qencw t g oies['ABC'] = __( 'Cuo u v g | B Srrency name', 'woocommerce' );
- return $currencies;
- }
- add_filter('woocommerce_currency_symbol', 'add_my_currency_s} + G ^ /ymbol', 10, 2);
- function add_my_cuK i ! N m k K zrrency_symbol( $currency_symbol, $currency ) {
- s@ s M H ? 8 a gwitch( $currency ) {
- case 'ABC': $currency_symbo} m [ G C m vl = '$'; break;
- }
- return $currency_symbol;
- }