Skip to content
Advertisement

Displaying full product description on product lightbox

Is there a WooCommerce add_action to display the full product description, this is the text found in the main text edit window (not the Product short description)

After a quick google search I was only able to find advice on adding the short description. The woocommerce_template_single_excerpt.

I’m trying to add it after the woocommerce_show_product_saleflash.

The light-box php is shown below.

  <?php
    do_action( 'woocommerce_before_single_product_lightbox_summary' );
  ?>
  </div>

  <div class="product-info summary large-6  col entry-summary" style="font-
size:90%;">
    <div class="product-lightbox-inner" style="padding: 30px;">
    <a class="plain" href="<?php echo the_permalink();?>"><h1><?php the_title(); ?></h1></a>
    <div class="is-divider small"></div>
<div><?php the_content(); ?></div> 


    <?php
      do_action( 'woocommerce_single_product_lightbox_summary' );
    ?>

    </div>
  </div><!-- .summary -->

</div><!-- #product-<?php the_ID(); ?> -->

</div><!-- product-container -->
</div>

<?php do_action('wc_quick_view_after_single_product'); ?>

Advertisement

Answer

The full product description is set in a tab, so the corresponding template is located in:
single-products/tabs/description.php.

You can unset easily this tab: Editing product data tabs (Removing tabs)

Then you can add this code anywhere, using any hook (the code from description.php template):

<?php the_content(); ?>

You can also use:

global $post;
echo $post->post_content;

Or (if the WC_Product object is available):

global $product;
echo $product->get_description();
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement