WooCommerce - How To Add Product Descriptions To Your Shop Catalog Pages


#1

Hello.

I need information on how to inplant description on the product shop list.

I did find this from an other site but this is not with your theme,

add_action( 'woocommerce_after_shop_loop_item_title', 'obox_woocommerce_product_excerpt', 35, 2); 
if (!function_exists('obox_woocommerce_product_excerpt'))  
{ 
     function lk_woocommerce_product_excerpt()  
     { 
     echo '<span class="excerpt">'; 
     the_excerpt(); 
     echo '</span>'; 
     } 
}

#2

Fixed it with some googling and Git hub

/**
 * Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price.
 *
 * Ref: https://gist.github.com/om4james/9883140
 *
 * Put this snippet into a child theme's functions.php file
 */
function woocommerce_after_shop_loop_item_title_short_description() {
	global $product;
	if ( ! $product->post->post_excerpt ) return;
	?>
	<div itemprop="description">
		<?php echo apply_filters( 'woocommerce_short_description', $product->post->post_excerpt ) ?>
	</div>
	<?php
}
add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_after_shop_loop_item_title_short_description', 5);