Description Tab Name & Default Open / Collapse

This topic has 9 replies, 4 voices, and was last updated 9 years, 7 months ago ago by Eva Kemp

  • Avatar: jjsparx
    jjsparx
    Participant
    May 21, 2015 at 00:24

    I would like to rename the tab section named “DESCRIPTION”, I also want to make it closed by default rather than opened.

    Please let me know where I can change these files.

    Many thanks,

    Jamie

    8 Answers
    Avatar: stan
    Stan Russell
    Participant
    May 21, 2015 at 07:44

    Hello,

    please check this part of Woocommerce documentation: http://docs.woothemes.com/document/editing-product-data-tabs/

    Regards,
    Stan Russell.

    Avatar: jjsparx
    jjsparx
    Participant
    May 21, 2015 at 10:43

    Thanks for this. I have tried adding their suggested fix to the functions.php file in the theme folder, but this breaks the site and I get a white page.

    Is there somewhere else I should be adding the code other than functions.php in the root theme folder?

    Many thanks,

    Jamie

    Avatar: Eva
    Eva Kemp
    Support staff
    May 21, 2015 at 12:28

    Hello,

    Please specify how you want to rename “Description” tab. We’ll try to do this for you.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: jjsparx
    jjsparx
    Participant
    May 21, 2015 at 12:32

    I’d like to be able to do this myself, I have experience of customising code so just point me in the right direction.

    Also there is a lot of repetition in the tabs – the titles say “DESCRIPTION” then directly underneath it says “Product Descrption” again which is unnecessary. The same goes for “Additional Info”, if you expand this tab it then has “Additonal Info” displayed underneath a second time.

    If you can tell me where the title is and where the sub title is and in what file I can do the rest.

    Avatar: Brian Johnson
    Brian Johnson
    Member
    May 21, 2015 at 12:50

    Hello

    All default woocommerce plugin strings for files can be found in wp-content/plugins/woocomerce/i18n/languages/****.pot file. You may use POEDIT text editor for translation and use right click on the words you mentioned. The same way you may use for theme default strings. Please open wp-content/themes/woopress/languges/***.po file and check any word you cannot edit using wordpres backend panel.

    With best regards
    Brian Johnson

    Avatar: Eva
    Eva Kemp
    Support staff
    May 21, 2015 at 13:50

    Hello,

    You need add this code in functions.php in wp-content/themes/royal directory to rename “Description” tab:

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

    Replace “More Information” text with your own.

    To remove additional titles from tabs add this code in custom.css file:

    .tabs .tab-content h2 {
     display: none !important;
    }

    How to create custom.css you can watch in this tutorial (it’s for Legenda theme but the process is the same).

    Regards,
    Eva Kemp.

    Avatar: jjsparx
    jjsparx
    Participant
    May 21, 2015 at 14:03

    Brillaint, thank you. That has worked.

    If I ever update the theme will the functions.php and custom.css stay unchanged?

    Avatar: Eva
    Eva Kemp
    Support staff
    May 21, 2015 at 14:29

    Hello,

    Custom.css will be saved, but functions.php will be reloaded.
    In this case you need create child theme http://codex.wordpress.org/Child_Themes and copy functions.php in there.

    Thank you.
    Regards,
    Eva Kemp.

  • Viewing 9 results - 1 through 9 (of 9 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.