Php 在称重前添加文本
我正在使用Woo变体表插件a,希望在阿曲布他体重之前添加文本。有办法吗?我能够在价格之前添加标签文字,但在重量方面运气不佳Php 在称重前添加文本,php,wordpress,woocommerce,product,hook-woocommerce,Php,Wordpress,Woocommerce,Product,Hook Woocommerce,我正在使用Woo变体表插件a,希望在阿曲布他体重之前添加文本。有办法吗?我能够在价格之前添加标签文字,但在重量方面运气不佳 // code add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' ); add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' ); function cw_change_pr
// code
add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' );
function cw_change_product_price_display( $price ) {
$text = __('TEXT');
// returning the text before the price
return $text . ' ' . $price;
}
add_filter( 'woocommerce_format_weight', 'woocommerce_format_weight', 10, 2 );
function woocommerce_format_weight( $weight_string, $weight ) {
return __( "Weight Text", "woocommerce" ) . $weight_string;
}