Change additional product information - by Luís Silva

This topic has 5 replies, 4 voices, and was last updated 3 years, 11 months ago ago by Olga Barlow

  • Avatar: Luís Silva
    Luís Silva
    Participant
    May 20, 2020 at 11:32

    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

    4 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 20, 2020 at 14:57

    Hello,

    “Additional information” is a default tab of WooCommerce – https://docs.woocommerce.com/document/editing-product-data-tabs/

    Regards

    Avatar: Luís Silva
    Luís Silva
    Participant
    May 22, 2020 at 13:01

    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

    Avatar: Adrian
    Adrian
    Participant
    May 22, 2020 at 13:40

    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();
    }
    
    
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 22, 2020 at 18:09

    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

  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.