Woocommerce:显示0个定价可变产品的常规价格

Woocommerce:显示0个定价可变产品的常规价格,woocommerce,Woocommerce,我使用此代码段将0 price替换为免费文本: /** * @snippet Display FREE if Price Zero or Empty - WooCommerce Single Product * @how-to Get CustomizeWoo.com FREE * @author Rodolfo Melogli * @testedwith WooCommerce 3.8 * @donate $9 https://busine

我使用此代码段将0 price替换为免费文本:

/**
* @snippet       Display FREE if Price Zero or Empty - WooCommerce Single Product
* @how-to        Get CustomizeWoo.com FREE
* @author        Rodolfo Melogli
* @testedwith    WooCommerce 3.8
* @donate $9     https://businessbloomer.com/bloomer-armada/
*/
  
add_filter( 'woocommerce_get_price_html', 'bbloomer_price_free_zero_empty', 9999, 2 );
   
function bbloomer_price_free_zero_empty( $price, $product ){
    if ( '' === $product->get_price() || 0 == $product->get_price() ) {
        $price = '<span class="woocommerce-Price-amount amount">FREE</span>';
    }  
    return $price;
}
/**
*@snippet价格为零或为空时显示免费-单个产品
*@how-to-Get CustomizeWoo.com免费
*@作者鲁道夫·梅洛格利
*@TestedWithWooCommerce 3.8
*@捐赠9美元https://businessbloomer.com/bloomer-armada/
*/
添加过滤器('woocommerce\u get\u price\u html','bbloomer\u price\u free\u zero\u empty',9999,2);
功能bbloomer\u price\u free\u zero\u empty($price,$product){
如果(“”==$product->get|U price()| 0==$product->get|U price()){
$price=‘免费’;
}  
返回$price;
}
我也需要显示正常价格。 我的目标是免费展示1.000,00 1.000,00 Free 我试图在这个片段中添加变量:

$regular\u price=wc\u get\u price\u含税($product->get\u regular\u price())

$sale\u price=wc\u get\u price\u含税($product->get\u sale\u price())
然后附加到$price

我怎样才能解决它