1

I have developed a very basic WordPress theme and installed WooCommerce. Every functionality of WooCommerce is perfectly working in my theme.

Issue: Only in product detailed page, product reviews tab, reviews listing and review form are missing.

Under WooCommerce settings reviews settings is enabled and in WordPress default discussion settings is also enabled.

For product detailed page I use 'single-product.php' template with following code.

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><?php the_title();?></h2>
<?php the_content();?>
<?php endwhile; endif; ?>

Note: When I add the following in my functions.php then entire store and WooCommerce stop working and everything gets distorted.

add_theme_support( 'woocommerce' );

Please suggest how to resolve this issue.

2 Answers2

6

if you have done code perfectly but please do not to forgot the Enable reviews option from the admin side in product.

Here I have explain the steps for your reference. In admin side product data -> Advanced -> Enable Reviews

enter image description here

Jagir bahesh
  • 361
  • 2
  • 9
3

You need to add this function and also check the comment is enable? Follow this link https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes

  function mytheme_add_woocommerce_support() {
  add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
  • I already tried this function and adding this distorted everything of my WooCommerce store and I was unable to access product details page then. –  Jan 08 '19 at 07:55
  • disabling comments will hide review form on product pages – Tasawar Hussain Feb 17 '22 at 02:45