WooCommerce, after moving reviews tab to under product description. If pagination link is clicked description is hidden

I used an unset $tab['reviews'] and added action to show reviews after product summary. It works great except

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

The 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744891464a4599438.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信