I used an unset $tab['reviews'] and added action to show reviews after product summary. It works great except for when people click on page 2 or 3 for comments. The pagination works, but then because of how reviews works, it hides the description until I click the tab for description.
Any ideas? Where does it tell that the description tab has to be hidden when reviews are paginated?
I used an unset $tab['reviews'] and added action to show reviews after product summary. It works great except for when people click on page 2 or 3 for comments. The pagination works, but then because of how reviews works, it hides the description until I click the tab for description.
Any ideas? Where does it tell that the description tab has to be hidden when reviews are paginated?
Share Improve this question asked Sep 1, 2018 at 21:45 DariusDarius 1171 silver badge12 bronze badges1 Answer
Reset to default 0The active tab is set in woocommerce/assets/js/frontend/single-product.js. Starting at line 11 this file looks for the words "comments" "reviews" or "tab-reviews" in the page url, and if found, it uses jQuery to click on the review tab. Since there is no review tab anymore, nothing gets clicked.
To solve this issue I overrode WooCommerce's single-product.js file by enqueue-ing a new js file under/after WC's single-product-min.js in the footer. I just copied the whole file into my theme and replaced "li.reviews_tab a" with "li.description_tab a" on lines 19 and 21. Not the most eloquent solution, but it worked for me.