Replace product short description (excerpt) with long description
-
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 descriptionI’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(); ?> </div> <?php endif; } add_action( 'woocommerce_single_product_summary', 'tf_do_product_desc', 55 );
Appreciate any ideas or answers. Thanks!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Replace product short description (excerpt) with long description’ is closed to new replies.