Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1079431
    pdopchev
    Participant

    Hello,

    Trying to do the following: rename the “Details” tab on single products only on certain pages. So far I have renamed the “Details” tab to “Materials Information” (the change is global) with the following php code added to functions.php:

    add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tabs’, 98 );
    function woo_rename_tabs( $tabs ) {

    $tabs[‘description’][‘title’] = __( ‘Materials Information’ ); // Rename the description tab

    return $tabs;

    }

    Any suggestions?

    link: http://www.dopchevproductions.com/test/product/the-80/

    #1079852
    Rue Nel
    Moderator

    Hi There,

    Thanks for writing in! Your code is valid and correct. If you want to rename the other tabs, you may use this code:

    function woo_rename_tabs($tabs) {
    
    	if ( $post->post_content ) {
    		$tabs['description']['title'] = __( 'Description' );
    	}
    
    	// Additional information tab - shows attributes
    	if ( $product && ( $product->has_attributes() || ( $product->enable_dimensions_display() && ( $product->has_dimensions() || $product->has_weight() ) ) ) ) {
    		$tabs['additional_information']['title'] = __( 'Additional Information' );
    	}
    
    	// Reviews tab - shows comments
    	if ( comments_open() ) {
    		$tabs['reviews']['title'] = sprintf( __( 'Reviews (%d)', 'woocommerce' ), $product->get_review_count() );
    	}
    
    	return $tabs;
    }
    add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );

    Hope this would help.

    #1080536
    pdopchev
    Participant

    Thanks for you help!

    Actually I am looking to have “Materials Information” instead of “Details” only on certain pages. For instance having it on this one: http://www.dopchevproductions.com/test/product/the-80-custom/ BUT have the original “Details” on this one instead of “Materials Information”: http://www.dopchevproductions.com/test/product/the-80/

    The change I made to the “Details” tab in the previous post is global, looking to apply it only to a few specific pages. Any ideas?

    #1080814
    Rupok
    Member

    Hey there,

    Thanks for writing back! Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself. If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.

    Thank you for your understanding.

  • <script> jQuery(function($){ $("#no-reply-1079431 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>