Add below code in fuctions.php file, it will add new tab in product detail page
add_filter( 'woocommerce_product_tabs', 'custom_woo_tab');
function custom_woo_tab( $tabs ) {
$tabs['test_tab'] = array(
'title' => __( 'Return Policy', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);
return $tabs;
}
Now, Add below code in same functions.php file for disply page content
function woo_new_product_tab_content() {
$page_id = YOUR_POST_ID;
$page_post_object = get_post( $page_id );
// Get the page content
$page_content = $page_post_object->post_content;
//Get the page title
$page_title = $page_post_object->post_title;
// The title (Or the page title)
echo '<h2>Coming Soon</h2>'; // Or: echo '<h2>' . $page_title . '</h2>';
// The page content
echo '<div class="page-content-container">' . $page_content . '</div>';
}
