WordPress.org

Support

Support » Plugins and Hacks » [Resolved] How to rearrange tabs viewed with Woocommerce

[Resolved] How to rearrange tabs viewed with Woocommerce

  • I have Woocommerce 2.0.2 installed. I was wondering how do i change the default tab view on a product page? right now it always shows the description first. I want to be able to select the Additional Information tab to be viewed first.

    how do i change this setting? I cant find any selection for this anywhere.

    Any help would be appreciated.

    Thanks

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 7 replies - 1 through 7 (of 7 total)
  • I used this filter to list my decription first. you can change the priorities so that your desired tab is firlst.

    add_filter( 'woocommerce_product_tabs', 'sb_woo_move_description_tab', 98);
    function sb_woo_move_description_tab($tabs) {
    
    $tabs['description']['priority'] = 5;
    $tabs['related']['priority'] = 10;
    $tabs['reviews']['priority'] = 20;
    
    return $tabs;
    }

    thanks for your information, i am sorry i am new at editing PHP files. Can you please eleborate….what file do i put those lines of code in and where do i find it?

    your assistance is appreciated

    Thanks

    wp-content/themes/yourtheme/functions.php

    add the code like so after the bit of text that tells you where to add custom functions.

    /*-----------------------------------------------------------------------------------*/
    /* End Theme Load Functions - You can add custom functions below */
    /*-----------------------------------------------------------------------------------*/
    add_filter( 'woocommerce_product_tabs', 'sb_woo_move_description_tab', 98);
    function sb_woo_move_description_tab($tabs) {
    
    $tabs['description']['priority'] = 5;
    $tabs['related']['priority'] = 10;
    $tabs['reviews']['priority'] = 20;
    
    return $tabs;
    }

    Finally got it working, I had to tweak a few settings to get the additional information to show up first in front of Description…

    here is what i had to put

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

    $tabs[‘description’][‘priority’] = 10;
    $tabs[‘additional_information’][‘priority’] = 5;
    $tabs[‘reviews’][‘priority’] = 20;

    return $tabs;
    }

    Thanks for your Help

    works like a charm

    Thanks WeddingAlbumCafe, the code worked perfectly for me 🙂
    Saved me a lot of time!
    Colin

    Note: If you have product reviews/comments disabled, the review tab will still be generated, without a label or content, which will look kinda wonky. I removed the line:

    $tabs['reviews']['priority'] = 20;

    Thanks WeddingAlbumCafe, been looking for this!

    nice, you can find documentation customization of woo commerce tab at http://docs.woothemes.com/document/editing-product-data-tabs/

    but if you have an empty tab’s content, your tab will generated tab without label and content. you can tweak it by yourself.
    i.e:

    if ( ! empty ( $tabs['description'] ) ) {
    $tabs['description']['priority'] = 25; // Description second
    }

    thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] How to rearrange tabs viewed with Woocommerce’ is closed to new replies.