-1

Hello we have custom product page as single-product.php and want to add reviews and its form but we are not getting its function or anything so how can we add reviews in custom single-product page?can anyone suggest me?

Ajay Paudel
  • 322
  • 1
  • 12
  • How do you used single-product.php have you copied it from woocommerce plugin and follow the way how woocommerce template override functionality works? – Krunal Prajapati Feb 13 '20 at 11:06
  • no i made it custom i didn't copy from woo-commerce – Ajay Paudel Feb 13 '20 at 11:19
  • You can just use `` – H. Bloch Feb 13 '20 at 11:23
  • but it doesn't give review form and reviews – Ajay Paudel Feb 13 '20 at 11:28
  • Actually if you override template in woocommerce method then all the default theme will work better you may check and get help from this link more about template overriding - https://docs.woocommerce.com/document/template-structure/ – Krunal Prajapati Feb 13 '20 at 12:04
  • its not about template overriding i have single-product.php whose design and structure are vase different then default product single page that's why i made single-product.php and now i have copy the file inside the theme also with woo-commerce folder and i have paste the all php file of templates inside that folder and placed the above code also but it's not giving that's the issue – Ajay Paudel Feb 14 '20 at 03:44

1 Answers1

-1

use this on single-product.php

<?php wc_get_template_part('single', 'product-reviews'); ?>
  • 1
    Your answer could be improved by adding more information on what the code does and how it helps the OP. – Tyler2P Jul 31 '22 at 08:47
  • Doesn't work without calling `comments_template()` before loading this template. Please, observe the answer to this question: https://stackoverflow.com/questions/38106667/woocommerce-call-review-form-in-other-than-product-page – Azamat Mar 06 '23 at 08:00