[resolved] Replace product short description (excerpt) with long description (8 posts)

  1. blogjunkie
    Posted 3 years ago #

    I want to replace the product short description that appears above the Add to Cart button with the long description ( the_content() ). There are 2 steps to this:

    1. Remove the short description (woocommerce_template_single_excerpt)
    2. Add the long description

    I'm having trouble with step #1. Here's the code that I've come up with so far:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. Not <pre>. ]

    /** Remove short description if product tabs are not displayed */
    function tf_reorder_product_page() {
    	if ( get_option('woocommerce_product_tabs') == false ) {
    		remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    add_action( 'woocommerce_before_main_content', 'tf_reorder_product_page' );
    /** Display product description the_content */
    function tf_do_product_desc() {
    	global $woocommerce, $post;
    	if ( $post->post_content ) : ?>
    		<div itemprop="description">
    			<?php $heading = apply_filters('woocommerce_product_description_heading', __('Product Description', 'woocommerce')); ?>
    			<!-- <h2><?php echo $heading; ?></h2> -->
    			<?php the_content(); ?>
    	<?php endif;
    add_action( 'woocommerce_single_product_summary', 'tf_do_product_desc', 55 );

    Appreciate any ideas or answers. Thanks!


  2. blogjunkie
    Posted 3 years ago #

    Whoops, realized that I made a stupid mistake in my code. Line 3 should be:

    get_option('woocommerce_product_tabs') == 'false'

  3. agruenke
    Posted 3 years ago #

    this is exactly what i am looking for... where do i post this edited code to make the change to my site? what PHP file do i need to edit? Your help is appreciated.

  4. dcputernut
    Posted 3 years ago #

    This is marked resolved....is it? like agruenke I want to do the same thing....but not sure what php to put it in

  5. blogjunkie
    Posted 3 years ago #

    You put the code above in your theme's functions file. What's a functions file?

    Answer here: http://www.binarymoon.co.uk/2007/05/wordpress-tips-and-tricks-functionsphp/

  6. Roy Ho
    Posted 3 years ago #

    functions.php of your theme folder.

  7. nggarciar
    Posted 2 years ago #


    i want to remove the short description but not inside the product as you says, I want to delete the short description that appears before entering the product information, you have the little image, the tittle the short description and the button add to cart, can you tell me hoy to delete that? thank you so much.

  8. ehong33234
    Posted 2 years ago #

    Is your code still valid? I put it into my functions.php and when I click UPDATE, it just goes to a blank white screen.

    I just copy/paste the code you have above below existing functions.php code but before the ?>


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic