Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1143999

    websperations
    Participant

    I am trying to change my WooCommerce product tabs text from “Description” to “Nutritional Information”.

    Click for Sample Product

    I have added the following code to my functions.php and it’s not working.

    add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
    function woo_rename_tabs( $tabs ) {
    
    	$tabs['description']['title'] = __( 'Nutritional Information' );		// Rename the description tab
    
    	return $tabs;
    
    }

    I got the code from: WooCoomerce Docs.

    How can I fix this or is there another way to change the tabs name?

    Thanks,

    Micah

    #1144000

    websperations
    Participant
    This reply has been marked as private.
    #1144156

    websperations
    Participant

    I added code to my functions.php to show the Additional Information tab.

    The Description tab changed to “Nutritional Information.

    I then removed the Additional Information code and reloaded the website.

    It’s still showing the Additional Information tab.

    I am confused as to what;s going on. This in on my VPS and and don’t have any caching installed on the server or within WordPress. I have cleared my browser cache and tried different browsers. I have also cleared the transients from within the WooCommerce Settings

    Here is my current functions.php code.

    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================
    
    // =============================================================================
    // TABLE OF CONTENTS
    // -----------------------------------------------------------------------------
    //   01. Enqueue Parent Stylesheet
    //   02. Additional Functions
    // =============================================================================
    
    // Enqueue Parent Stylesheet
    // =============================================================================
    
    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
    
    // Additional Functions
    // =============================================================================
    
    //Rename WooCommerce Tabs
    // =============================================================================
    
    add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
    function woo_rename_tabs( $tabs ) {
    
    	$tabs['description']['title'] = __( 'Nutritional Information' );		// Rename the description tab
    
    	return $tabs;
    
    }
    
    // Change the add to cart button INTO View Product button
    // =============================================================================
    
    add_filter( 'woocommerce_loop_add_to_cart_link', 'add_product_link' );
    function add_product_link( $link ) {
        global $product;
        echo '<a href="'.$product->get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . '</a>';
    }

    What am I missing?

    Thanks,

    Micah

    #1144504

    Christopher
    Moderator

    Hi there,

    Please disable ‘Additional information’ tab from Customize -> Woocommerce, please see the attachment.

    Hope it helps.

    #1146123

    websperations
    Participant

    Thanks for pointing that out to me.

    All seems to be the way I want it to be now.

    Micah

    #1146253

    Christian
    Moderator

    You’re welcome, Micah. Glad we could help. 🙂