Skip to content

Instantly share code, notes, and snippets.

@woogist
Created November 4, 2013 13:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogist/7302382 to your computer and use it in GitHub Desktop.
Save woogist/7302382 to your computer and use it in GitHub Desktop.
WooCommerce - rename additional information tab
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
global $product;
if( $product->has_attributes() || $product->has_dimensions() || $product->has_weight() ) { // Check if product has attributes, dimensions or weight
$tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab
}
return $tabs;
}
@brazuka
Copy link

brazuka commented Feb 3, 2014

I am having a hard time deleting the Add. Info Tab on the product page - here is the code I added...

add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );

function woo_rename_tabs( $tabs ) {

global $product;

if( $product->has_attributes() || $product->has_dimensions() || $product->has_weight() ) { // Check if product has attributes, dimensions or weight
    $tabs['additional_information']['title'] = __( 'Product Data' );    // Rename the additional information tab
}

return $tabs;

}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );

function woo_remove_product_tabs( $tabs ) {

unset( $tabs['product_data'] );     // Remove the product data tab

return $tabs;

}

Any suggestions?

@tipsdigital
Copy link

woocommerce remove description tabs but keep product: https://www.youtube.com/watch?v=-PS7R08SY_4
Add following code in your CSS Theme file:
`.woocommerce-tabs .panel
{
padding: 20px !important;
}

.woocommerce-tabs .panel
{
margin-left: 5px !important;
}

.woocommerce-tabs .tabs li a {
display: none !important;
}`

@reachdigitalaus
Copy link

I was having issue with empty tabs still showing up showing up and renaming, this now works for me

`add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {

global $product;

if( $product->has_attributes() || $product->has_dimensions() || $product->has_weight() ) { // Check if product has attributes, dimensions or weight
	$tabs['additional_information']['title'] = __( 'More Info' );	// Rename the additional information tab
}

return $tabs;

}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment