Вот код, который добавляет метку для определенных идентификаторов продуктов. Как добавить цену самого дорогого варианта товара перед меткой и разделить ее:function themeprefix_custom_price_message( $price2 ) {
global $post;
$product_id = $post->ID;
$my_product_array = array( 45491, 46549, 54757 );//add in product IDs
$product = wc_get_product( $id );
if ( in_array( $product_id, $my_product_array )) {
$textafter = '
per piece'; //add your text
return $price2 . '' . $textafter . '';
}
else
{
return $price2;
}
}
add_filter( 'woocommerce_get_price_html', 'themeprefix_custom_price_message' );
Подробнее здесь: https://stackoverflow.com/questions/792 ... -a-price-b
Мобильная версия