Forked from ben-heath/add-to-woocommerce-additional-info-tab-single-product.php
Created
December 28, 2017 09:45
-
-
Save jamiemitchell/db9e6a27347ea2508eb02fb38ef1f043 to your computer and use it in GitHub Desktop.
Add content to WooCommerce Additional Information Tab on Single Products
This file contains 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
<?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