How to remove woocommerce tab?

前端 未结 6 1064
[愿得一人]
[愿得一人] 2021-01-11 18:51

the products in our woocommerce shop don\'t need any of the default tabs so I have managed to disable them being that I only need to have the product description below the p

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-11 19:35

    add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
    
    function woo_remove_product_tabs( $tabs ) {
        unset( $tabs['description'] );          // Remove the description tab
        unset( $tabs['reviews'] );          // Remove the reviews tab
        unset( $tabs['additional_information'] );   // Remove the additional information tab
        return $tabs;
    }
    
    function woocommerce_template_product_description() {
        woocommerce_get_template( 'single-product/tabs/description.php' );
    }
    
    add_action( 'woocommerce_after_single_product_summary',  'woocommerce_template_product_description', 40 );
    

    This work for me with the contributions i got here. Other than removing the tab and also to place back the text.

    Credits to Swapnali & Mustafa

提交回复
热议问题