2013-07-11 48 views

回答

3

试试这个:

add_filter('woocommerce_price_format', 'overwrite_woocommerce_price_format', 10, 2); 

function overwrite_woocommerce_price_format($format, $currency_pos) { 
    global $post; 
    if ($post->post_type != 'product') return $format; 
    $custom_field = get_post_meta($post->ID, 'unit_description', true); // This will return your custom field value 
    return $format . ' ' . __($custom_field, 'woocommerce'); // Here you'll append your custom field with price 
} 

希望这将有助于

+0

完美工作谢谢Ratnakar – Meko6

+0

太好了!感谢您的确认 –