Support » Plugin: WC Product Tabs Plus » Conditional Tabs

  • Resolved ivanpm

    (@ivanpm)


    I have a store where I sell different types of products. I want different tabs (or no to tabs at all) to show depending on the product type (could be category or tag).

    ¿How can I do this?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter ivanpm

    (@ivanpm)

    The title of the Tab appears inside the content of the tab.

    ¿How can I disable this form happening?

    Plugin Author Wooninjas

    (@wooninjas)

    Hi,

    First question:
    Unfortunately, there is no such support in the plugin to disable tabs or create different tabs based on category, however, you can do this by using the hook woocommerce_product_tabs provided by WooCommerce. You do have the ability to exclude/modify/add tabs using this hook.

    Second question:
    No default option to hide tabs title inside tab content as it appears on every tab even WooCommerce core ones. But again, It can be adjusted using the above-mentioned hook.

    Thanks.

    • This reply was modified 4 years, 7 months ago by Wooninjas.
    • This reply was modified 4 years, 7 months ago by Wooninjas.
    Thread Starter ivanpm

    (@ivanpm)

    Hello:

    What I meant is that the name of the standard Description WC tab is displayed only once on the tab name, not on the contents Inside the tab.

    However if I add a global tab named Details, the name appears appears twice, once on the tab name and also again inside the tab contents.

    Is this normal?

    Don’t know how to send you a screenshot.

    Plugin Author Wooninjas

    (@wooninjas)

    Hi @ivanpm

    Is this normal?

    Yes, it is. We are following the WC standard and so it does the same, display title under description.

    To be specific, you said Description title shows only on the tab name but not in the contents, while this may be true for the theme you are using.
    Can you name your active theme?

    However if I add a global tab named Details, the name appears twice, once on the tab name and also again inside the tab contents.

    You can pretty much do anything to change the output of title/tab contents via the filter hook.

    Quick solution to hide tab title in tab content for all tabs

    add_filter('wptp_tab_object', function( $product_tab ) {
        unset( $product_tab->title );
        return $product_tab;
    });
    

    Note: Make sure you update the plugin to latest version (1.0.3). And this applies to the tabs that we manage.

    Don’t know how to send you a screenshot.

    Upload image to some free service like dropbox/google drive and share the link here.

    Thanks

    • This reply was modified 4 years, 7 months ago by Wooninjas.
    • This reply was modified 4 years, 7 months ago by Wooninjas.
    • This reply was modified 4 years, 7 months ago by Wooninjas.
    Thread Starter ivanpm

    (@ivanpm)

    Thank you very much for being so responsive. Being somewhat of a novice I need to ask where to add this filter.

    What PHP file? What part of the file?

    I added it to wc-product-tabs-plus.php and it had no effect.

    I say thanks in advance.

    Plugin Author Wooninjas

    (@wooninjas)

    Welcome Ivanpm 🙂
    You can add this filter to the file functions.php of your active theme, you can find this file inside
    /wp-content/themes/{your-active-theme}

    Thread Starter ivanpm

    (@ivanpm)

    Hello again:

    My theme is Aurum.

    I added the code to the functions.php and nothing happens.

    Sorry to keep bugging you.

    Maybe I should contact the Aurum developers.

    Iván

    Plugin Author Wooninjas

    (@wooninjas)

    Did you update the plugin to the latest version.? and where exactly did you paste the above code, can you show the contents of your functions.php file. ?

    • This reply was modified 4 years, 7 months ago by Wooninjas.
    • This reply was modified 4 years, 7 months ago by Wooninjas.
    Thread Starter ivanpm

    (@ivanpm)

    Success!

    I thought I had the latest version but did not.

    How do I give you a 5 star review? Never done this.

    Thanks again for your help.

    Thread Starter ivanpm

    (@ivanpm)

    I already posted my review.

    Plugin Author Wooninjas

    (@wooninjas)

    Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Conditional Tabs’ is closed to new replies.