Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 商业中的多种货币未显示_Wordpress_Woocommerce_Plugins - Fatal编程技术网

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

我是Wordpress插件开发的新手。我面临一些问题。显示一种货币付款,以便显示多种货币付款的方式。 下面的代码显示一种货币

// 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 );

你问的问题不清楚。请详细说明您面临的问题,以便我们能够更轻松地提供帮助。用“这件事正在发生,但我希望这件事”这样的措辞会有所帮助。你问的是什么问题还不清楚。请详细说明您面临的问题,以便我们能够更轻松地提供帮助。用“这件事正在发生,但我希望这件事”这样的措辞会有所帮助。