Site icon Anthony Carbon

Woocommerce single product filters and hooks custom customization

Renaming existing tabs.

add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {   
	$tabs['description'] = array(
            'title' => __( 'WORKING', 'woocommerce' ),
            'priority' => 10,
            'callback' => 'the_content'
			);	 
	$tabs['reviews'] = array(
            'title' => __( 'FAULTY', 'woocommerce' ),
            'priority' => 30,
            'callback' => 'woo_before_tabs_title'
			); 
	return $tabs; 
}  
function woo_before_tabs_title() {    
	the_field('faulty');
}

This code works on how to remove the review tab in single product page.

add_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 );
    function wcs_woo_remove_reviews_tab($tabs) {
    unset($tabs['reviews']);
    return $tabs;
}
Exit mobile version