0
votes

I'm currently working on a custom WooCommerce from a WordPress theme I have built from scratch. So far everything is working perfectly but I have come across an issue that I can't seem to get my head around. When I click on a product I am taken to the single product page, everything works as expected when I scroll down to the tabs section I am seeing the Description tab, but there is no reviews tab. I spent a big chunk of the weekend trying to find a solution to displaying this but I have been unsuccessful.

I have searched the project for the following lines to make sure I haven't disabled the functionality.

remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);

I am completely stumped now. I have tried Google to find a solution, but I can only find articles and forum posts for pre-existing bought themes. Now I'm left wondering if I have actually missed something. I can display the review stars and it is correctly displaying the number of reviews but when I click on the url to go to the reviews the address bar displays wp-lds-shop/product/happy-ninja/#reviews.

I would really appreciate any help or advice on this.

3
Have you customized the WooCommerce templates in any way that may have affected the tabs?Michael
Hey Michael, no I haven’t touched any of the templates. I might try a fresh Woocommerce install to see if this remedies the issueflying-dev

3 Answers

1
votes

I have found the following solution, which worked for me. You have to declare WooCommerce support, otherwise the "Review" tab will not show up.

I followed this link: https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes and added this code at the bottom of my functions.php

function mytheme_add_woocommerce_support() {
  add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );

I hope this works for you!

0
votes
0
votes

just add to function.php template

add_filter( 'woocommerce_product_tabs', 'yikes_remove_description_tab', 20, 1 );

    function yikes_remove_description_tab( $tabs ) {

        // Remove the description tab
        if ( isset( $tabs['description'] ) ) unset( $tabs['description'] );             
        return $tabs;
    }