Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jamiemitchell/db9e6a27347ea2508eb02fb38ef1f043 to your computer and use it in GitHub Desktop.
Save jamiemitchell/db9e6a27347ea2508eb02fb38ef1f043 to your computer and use it in GitHub Desktop.
Add content to WooCommerce Additional Information Tab on Single Products
<?php
// This code should be added to the functions.php file of the child theme
// Add custom info to Additional Information product tab
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
global $product;
$tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below
return $tabs;
}
function custom_function_name(){
echo 'New Content Here'; //add anything you want to show before the default tab content
woocommerce_product_additional_information_tab(); // This function calls wc_get_template( 'single-product/tabs/additional-information.php' );
echo 'New Content Here'; //add anything you want to show after the default tab content
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment