Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce - description in products page

I need to add little excerpt from description on my "product" in Woocommerce plugin. I have page like this: http://exploreprague.cz/guides-buddies-2/ and I need to have some description text under the name of each person... is there any way to do it?

like image 488
Mythago Avatar asked Dec 04 '22 00:12

Mythago


1 Answers

That category page with the products inside is: woocommerce >> templates >> content-product.php

And you can find that only function to show the Title inside this page as:

<h3><?php the_title(); ?></h3>

After that line you can add your own lines:

<br /><?php echo $product->get_sku(); ?> <br /><?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>

These will display the SKU and the short-description of the product.

Btw, this is just a quick hard-coded method, you can try to add these functions to the hook on that page in your theme's functions.php.

add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_single_excerpt', 5);

As it is mentioned in that hooks comments section that the PRICE is already hooked in there.

like image 189
Jason Weber Avatar answered Dec 26 '22 08:12

Jason Weber