Remove single product tabs and add the related content instead In Woocommerce

 ̄綄美尐妖づ 提交于 2019-12-04 12:07:45

First woocommerce_get_template() is deprecated and replaced by wc_get_template() instead. After some searching and testing (mainly to get the reviews displayed), I have found the way:

add_action( 'woocommerce_after_single_product_summary', 'removing_product_tabs', 2 );
function removing_product_tabs(){
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
    add_action( 'woocommerce_after_single_product_summary', 'get_product_tab_templates_displayed', 10 );
}
function get_product_tab_templates_displayed() {
    wc_get_template( 'single-product/tabs/description.php' );
    wc_get_template( 'single-product/tabs/additional-information.php' );
    comments_template();
}

Code goes in function.php file of your active child theme (or theme). Tested and work (WC 3+).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!