Wordpress 商业中的多种货币未显示
我是Wordpress插件开发的新手。我面临一些问题。显示一种货币付款,以便显示多种货币付款的方式。 下面的代码显示一种货币Wordpress 商业中的多种货币未显示,wordpress,woocommerce,plugins,Wordpress,Woocommerce,Plugins,我是Wordpress插件开发的新手。我面临一些问题。显示一种货币付款,以便显示多种货币付款的方式。 下面的代码显示一种货币 // Show product prices in fiat + crypto function mcc_woocommerce_get_price_html( $text, $product ) { // Is MCC installed? if ( ! function_exists( 'mycryptocheckout' ) ) re
// Show product prices in fiat + crypto
function mcc_woocommerce_get_price_html( $text, $product )
{
// Is MCC installed?
if ( ! function_exists( 'mycryptocheckout' ) )
return $text;
// Retrieve all of our currencies.
$currencies = MyCryptoCheckout()->currencies();
// Change this to your preferred currency symbol
$show_currency = 'BCH';
$currency = $currencies->get( $show_currency );
// Is this currency known?
if ( ! $currency )
return $text;
$new_price = $currency->convert( get_woocommerce_currency(), $product->get_price() );
return $text . ' / ' . $new_price . ' ' . $show_currency;
}
add_filter( 'woocommerce_get_price_html', 'mcc_woocommerce_get_price_html', 100, 2 );
你问的问题不清楚。请详细说明您面临的问题,以便我们能够更轻松地提供帮助。用“这件事正在发生,但我希望这件事”这样的措辞会有所帮助。你问的是什么问题还不清楚。请详细说明您面临的问题,以便我们能够更轻松地提供帮助。用“这件事正在发生,但我希望这件事”这样的措辞会有所帮助。