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
add comment

3 Answers

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
add comment
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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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