Home › Forums › WoodMart support forum › WooCommerce Tabs Closed by Default
WooCommerce Tabs Closed by Default
- This topic has 11 replies, 2 voices, and was last updated 5 years, 7 months ago by Jeriss Cloud Center.
-
AuthorPosts
-
May 17, 2019 at 9:53 am #124221
Jeriss Cloud CenterParticipantDear,
I’ve found a ticket from another user about closing the WooCommerce tabs by default. I tried to apply the code you’ve provided but it doesn’t work.
setTimeout(function() { var $tabs = jQuery( '.wc-tabs, ul.tabs' ).first(); $tabs.parent().find('#tab-description').hide(); $tabs.parent().find( '.tab-title-description' ).removeClass('active'); }, 10);
Can you check please?
ThanksMay 17, 2019 at 10:40 am #124245
Artem TemosKeymasterHi,
This code is for the description tab and your product page doesn’t have it at all.
Regards
May 17, 2019 at 11:38 am #124268
Jeriss Cloud CenterParticipantHi Artem,
I’ve added description tab and the code doesn’t work neither. Can you check please?
Also, how could the code be amended in such way that it also works when it’s the Review tab that is first (meaning when there are no “description tab”) ?
Thanks
May 17, 2019 at 11:40 am #124269
Artem TemosKeymasterTry to increase the timeout
10
to100
,500
, or1000
.May 17, 2019 at 12:54 pm #124277
Jeriss Cloud CenterParticipantArtem,
I tried the different timeout values. It works with 500 and 1000 but with a little issue. It still opens and re-closes it after the page load. https://gevcen.tinytake.com/tt/MzUzMjUxN18xMDYxODMyNw
Can you check ?
May 17, 2019 at 1:17 pm #124285
Artem TemosKeymasterYes, it is how this supposed to work. It is a bit tricky but there are no other solutions for this task.
May 17, 2019 at 3:03 pm #124313
Jeriss Cloud CenterParticipantOk thanks. And how about my other question : how could the code be amended in such way that it also works when it’s the Review tab that is first (meaning when there are no “description tab”) ?
Thanks
May 17, 2019 at 5:07 pm #124325
Artem TemosKeymasterTry to change words
description
withreviews
in that code.May 17, 2019 at 5:43 pm #124331
Jeriss Cloud CenterParticipantYes it worked! For anyone interested :
setTimeout(function() { var $tabs = jQuery( '.wc-tabs, ul.tabs' ).first(); $tabs.parent().find('#tab-description').hide(); $tabs.parent().find( '.tab-title-description' ).removeClass('active'); }, 1000); setTimeout(function() { var $tabs = jQuery( '.wc-tabs, ul.tabs' ).first(); $tabs.parent().find('#tab-reviews').hide(); $tabs.parent().find( '.tab-title-reviews' ).removeClass('active'); }, 1000);
You can close the ticket, thanks
May 19, 2019 at 11:00 am #124499
Jeriss Cloud CenterParticipantArtem,
Just one thing more, I’m trying to apply the same for the tab “Additional information” (table with attribute characteristics) but it’s not working.
Can you help please?
May 19, 2019 at 12:43 pm #124506
Jeriss Cloud CenterParticipantI managed it 🙂
/** * Collapse the Description tab when it comes first in the accordion */ setTimeout(function() { var $tabs = jQuery( '.wc-tabs, ul.tabs' ).first(); $tabs.parent().find('#tab-description').hide(); $tabs.parent().find( '.tab-title-description' ).removeClass('active'); }, 1000); /** * Collapse the Reviews tab when it comes first in the accordion */ setTimeout(function() { var $tabs = jQuery( '.wc-tabs, ul.tabs' ).first(); $tabs.parent().find('#tab-reviews').hide(); $tabs.parent().find( '.tab-title-reviews' ).removeClass('active'); }, 1000); /** * Collapse the Additional Information tab when it comes first in the accordion */ setTimeout(function() { var $tabs = jQuery( '.wc-tabs, ul.tabs' ).first(); $tabs.parent().find('#tab-additional_information').hide(); $tabs.parent().find( '.tab-title-additional_information' ).removeClass('active'); }, 1000);
May 20, 2019 at 9:54 am #124638
Jeriss Cloud CenterParticipantYou can close the ticket, thanks
-
AuthorPosts
The topic ‘WooCommerce Tabs Closed by Default’ is closed to new replies.
- You must be logged in to create new topics. Login / Register