Problem with Reviews in WooCommerce 2.0.20 not showing
by Logan Rogers-Follis on Dec.14, 2013, under Techie
Currently I’ve been working on a new site for JoeFrank.com and with the help of a designer it is almost ready to launch, but the problem is now that I can not see (if I add via Admin) nor Add (as a customer would) any Reviews. After a lot of hunting around I found that the following was missing from my “../wp-content/themes/canvas/functions.php”:
add_action('woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
add_action('woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);
I add those lines in and got an error about “../wp-content/plugins/woocommerce/templates/single-product/tabs/reviews.php” missing (basically) and when I looked there was no file. I downloaded a new copy of WooCommerce and that file is not there at all. After a fair bit of hunting I found the following code from a GitHub post (when I find the post I’ll link to it):
<?php
/**
* Reviews tab
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
global $woocommerce, $post;
if ( comments_open() ) : ?>
<div class="panel entry-content" id="tab-reviews">
<?php comments_template(); ?>
</br>
</div>
<?php endif; ?>
This works just fine for my needs with the custom theme and the version of WooCommerce we are using.
Finally after all of this I was still getting 1 error. The error was “uasotrt() expects parameter 1 to be array, null given in…” and was in the “../wp-content/plugins/woocommerce/woocommerce-template.php” file on line 795. I just went in and commented out LINE 795: uasort( $tabs, '_sort_priority_callback' );
since I have no other tabs the way it is setup.
Now Reviews show perfectly and people can add them! Hope some one else finds this post and saves themselves a few days of research and random troubleshooting to figure out a fix.
..or maybe it’s just me and everyone already knows.