According to this post remove everything after first comma from string in php
I need customize this line in Wordpress:
<div class="text-center font-weight-bold" style="font-size: 16px; line-height: 16px; text-decoration: underline;">
<?php
echo rtrim( wp_trim_words( get_the_title(), 2, '' ), ',' );
?>
</div>
It works good, but some product titles need to be longer than two words, so i need all words before comma character.