I have found out how to add a short description to the thumbnails for products in WooCommerce, but how do I truncate them to a certain length, say 30 characters. All the answers to do with editing the functions.php file dont mention where in the file to put the code.
My code in my functions.php file is:
add_action('woocommerce_after_shop_loop_item_title','add_title_description',9);
function add_title_description(){
echo get_post_meta($product->id, 'title-description', true)? '<span class="title-description">' . get_post_meta($product->id, 'title-description', true) . '</span><br />' : '';
}