Created
November 4, 2013 13:24
-
-
Save woogist/7302382 to your computer and use it in GitHub Desktop.
WooCommerce - rename additional information tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
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;
}`
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
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 ) {
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
}
Any suggestions?