Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been changing the way that the Single product page looks. I've moved a few things about by hooking into Woocommerce and also editing the css.

Out of the box the single product page shows the short description (described as woocommerce_template_single_excerpt in the content-single-product.php file) next to the product image, but I want to show the full description.

The full description is shown in the product data tabs underneath the product. Looking in the tabs directory at the description.php file it seems to just set the heading. Presumably as the product is a custom post type the product description is the content of the custom post.

I've worked around it by putting the full description in the product short description section but I'd like a solution that doesn't require someone adding products to have to do this.

Can anyone suggest a way of doing this please?

share|improve this question

closed as off-topic by Rarst Jun 5 at 13:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

    
This is specific to wordpress - can it please be reopened. –  Dave Hilditch Oct 7 at 13:01

4 Answers 4

I never understood this either from woocommerce... I'd expect a 'product description' as the main post info and then perhaps 'detailed description' or 'additional product information' in the tab.

in templates/single-product/short-description.php replace

if ( ! $post->post_excerpt ) return;
?>
<div itemprop="description">
    <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>

with

if ( ! the_content() ) return;
?>
<div itemprop="description">
    <?php echo the_content(); ?>

then in templates/single-product/tabs/description.php replace

<?php the_content(); ?>

with

<?php the_excerpt(); ?>
share|improve this answer
    
Hi, I actually found the same thing yesterday and have been thinking about whether it can be used or needs modification. This answer changes the short description everywhere it is used and I'm not sure if I want to do that. I may be able to write a function using this answer and hook it into the single product page (content-single-poduct.php) so that only that page is changed. –  paultp Apr 22 '13 at 7:53
    
I don't understand what you mean, these are only the single-page templates... AFAIK the woocommerce single-single templates are not used anywhere else. –  Ewout Apr 22 '13 at 14:58
    
Thanks, you're right. Woocommerce confirmed it. They gave me a slightly different fix so I'll put that in as a new answer. Thanks for your help. –  paultp Apr 24 '13 at 16:03
up vote 0 down vote accepted

Slightly different fix provided by Woocommerce so I thought I should include it here:

In templates/single-product/short-description.php where it says:

    $post->post_excerpt 

Replace this (2 occurrences) with;

    $post->post_content 

Thanks

share|improve this answer

Instead of editing the template you could also try this:

<?php

/** Remove short description if product tabs are not displayed */
function dot_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', 'dot_reorder_product_page' );

/** Display product description the_content */
function dot_do_product_desc() {

    global $woocommerce, $post;

    if ( $post->post_content ) : ?>
        <div itemprop="description" class="item-description">
            <?php $heading = apply_filters('woocommerce_product_description_heading', __('Product Description', 'woocommerce')); ?>

            <!-- <h2><?php echo $heading; ?></h2> -->
            <?php the_content(); ?>

        </div>
    <?php endif;
}
add_action( 'woocommerce_single_product_summary', 'dot_do_product_desc', 20 );
share|improve this answer

Use woocommerce template in price.php

add_action( 'woocommerce_after_shop_loop_item_title', 'my_add_short_description', 9 );
function my_add_short_description() {
      echo '<span class="title-description">' . the_excerpt() . '</span><br />';
} 
share|improve this answer
1  
Please do not just dump code but explain what it does and how it solves the problem. –  kraftner Jun 5 at 13:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.