In this tutorial we’ll learn how to display product summary from single product page to sidebar of woocommerce.
Here is the default product screen:
Now we need to display the bordered content in the sidebar.
To do this add the following lines of code in your theme’s sidebar.php file:
<?php if(is_product()) { do_action( 'woocommerce_single_product_summary' ); } ?>
You can access sidebar.php file here:
Place the code and click on Update File button to save it.
Now, if you’ll go to product page again you’ll see the product related content being displayed in sidebar.
You can remove the unnecessary content with CSS.
CHEERS J