在重量 WooCommerce 之前添加文本
Add text before Weight WooCommerce
我正在使用 Woo Variations Table 插件 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_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;
}
我正在使用 Woo Variations Table 插件 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_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;
}