WooCommerce 添加自定义货币/符号,将 PHP 代码放在主题或子主题 functions.php 文件的底部。
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'Currency name', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'ABC': $currency_symbol = '$'; break;
}
return $currency_symbol;
}
专业提供WordPress主题安装、深度汉化、加速优化等各类网站建设服务,详询在线客服!