• Resolved joaodosantos

    (@joaodosantos)


    I was wondering if you could help me out.

    I’m currently working on the website and I installed the plugin to be able to create different tabs to different types of finishes.
    When there’s only one tab, that tab opens automatically on the product page.
    However, when there’s two different tabs, we have to click on the tab to open.

    Is there a way for one of them opens automatically when we enter the page?

    Thank you very much,
    João Santos

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @joaodosantos,

    When you have the default WooCommerce tab layout you can only have one tab open per time. If you’d like to have multiple tabs open at the same time, you’ll need to use a different tabs layout.

    Are you familiar with replacing WooCommerce templates? There are a ton of free resources online that can walk you through this process.

    Let me know.

    Thank you,
    Kevin.

    Thread Starter joaodosantos

    (@joaodosantos)

    Hi @yikesitskevin

    I don’t need to have two tabs open at the same time. Maybe I could’t make myself clear and sorry but I’m kinda new to this.

    When I enter my product page, I need for the custom tab to be already open. This already happens when I have only one custom tab, but when I have multiple, neither tab opens automatically (you can see the case of this product: https://cobermasterconcept.com/en/product/gap-sideboard/ )
    If you follow the link and scroll down, there are two tabs, but you need to click on them to open. Is there a way for one of them to open automatically when you open the page?

    Thank you very much,

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Joao,

    Ah! I understand and I see the error. Let me look into this. I’ll get back to you.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @joaodosantos,

    The problem is that you have a description tab on your products that is being hidden. This is actually the first tab so it is trying to be displayed. However, there is custom CSS that is hiding it:

    li.description_tab {
        display: none !important;
    }

    If you’d like to remove the description tab, you should use the following filter function. This will safely remove the tab and you won’t run into the issue you’re currently experiencing where the first tab appears hidden.

    This is the filter function. Are you familiar with adding filter functions to your website?

    // Remove Tabs.
    add_filter( 'woocommerce_product_tabs', 'yikes_woo_remove_tabs', 20, 1 );
    
    function yikes_woo_remove_tabs( $tabs ) {
    
    	// Remove the description tab.
    	if ( isset( $tabs['description'] ) ) {
    		unset( $tabs['description'] );
    	}
    
    	return $tabs;
    }

    Let me know.

    Thank you,
    Kevin.

    Thread Starter joaodosantos

    (@joaodosantos)

    Hi @yikesitskevin ,

    Thank you very much for your help. I added the filter in my theme’s functions and now it’s perfect.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Custom Tab to open automatically’ is closed to new replies.