This topic has 5 replies, 4 voices, and was last updated 4 years, 6 months ago ago by Olga Barlow
Hello,
I need to add code to the additional product information tab, but I can’t find the file where the code is. Could you tell me where I can find the file?
Thank you
Hello,
“Additional information” is a default tab of WooCommerce – https://docs.woocommerce.com/document/editing-product-data-tabs/
Regards
Hello,
Thanks for help, but I need know what is the file location with html of the page. In reality I want to add a custom foreach of content of the specific attribute
It’s not a specific file. You add the code snippet to your theme’s functions.php file. For instance, the code bellow will put the Short description info instead of the default content of the “Additional information” tab. Be sure yo backup your file before modifying.
add_filter( 'woocommerce_product_tabs', 'woo_custom_description_tab', 98 );
function woo_custom_description_tab( $tabs ) {
$tabs['additional_information']['callback'] = 'woo_custom_additional_information_tab_content'; // Custom description callback
return $tabs;
}
function woo_custom_additional_information_tab_content() {
//echo '<h2>Custom Description</h2>';
global $product;
echo $product->get_short_description();
}
Hello,
Yes, it’s not a specific file, besides it’s not related to our theme but to WooCommerce plugin because it’s default WooCommerce tab. If you want to change something use child theme, don’t make any changes in the parent theme because you will lose them after the update.
Regards
You must be logged in to reply to this topic.Log in/Sign up