我的Woocommerce很难将提要发送到Amazon SellerCentral。 亚马逊要求EUR为woocommerce_currency值,但Woocommerce返回€。 如何更改该值? 非常感谢。
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol',
10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'EUR': $currency_symbol = 'EUR'; break;
}
return $currency_symbol;
}
答案 0 :(得分:1)
您将能够自定义货币,该货币将显示在后端货币选择下拉列表中。
add_filter( 'woocommerce_currencies', 'add_cw_currency' );
function add_cw_currency( $cw_currency ) {
$cw_currency['CLOUDWAYS'] = __( 'CLOUDWAYS CURRECY', 'woocommerce' );
return $cw_currency;
}
add_filter('woocommerce_currency_symbol', 'add_cw_currency_symbol', 10, 2);
function add_cw_currency_symbol( $custom_currency_symbol, $custom_currency ) {
switch( $custom_currency ) {
case 'CLOUDWAYS': $custom_currency_symbol = 'CW$'; break;
}
return $custom_currency_symbol;
}
以下链接几乎没有解释,希望对您有所帮助。 https://www.cloudways.com/blog/add-custom-currency-symbol-in-woocommerce/
谢谢!
答案 1 :(得分:0)
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'USD': $currency_symbol = 'EUR >>'; break;
//case 'EUR': $currency_symbol = 'EUR'; break;
}
return $currency_symbol;
}
答案 2 :(得分:0)