By default In WooCommerce product description full format so If we need to show into some characters or into short format then we need to add following code as per instructions.
Note: ‘Read More’, word length, variable names all are user defined so change as per your consideration 🙂
In functions.php file add below hook
add_filter( 'woocommerce_short_description', 'prefix_filter_woocommerce_short_description' );
function prefix_filter_woocommerce_short_description( $post_post_excerpt ) {
// make filter magic happen here…
if(! is_product() ) { // add in conditionals
$text = $post_post_excerpt;
$words = 10; // You can change word length
$more = '… Read More'; // add a any word
$post_post_excerpt = wp_trim_words( $text, $words, $more );
}
return $post_post_excerpt;
};
For custom template add below code within foreach product loop/while product loop
global $product;
$desc_pro = $product->get_short_description(); //get product description
$words = 10; // You can change word length
$more = '… Read More'; // add a any word