admin管理员组文章数量:1405112
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.
本文标签:
版权声明:本文标题:WooCommerce, after moving reviews tab to under product description. If pagination link is clicked description is hidden 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744891464a2630806.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论