Home Forums WoodMart support forum Collapse Product Details Tab

Collapse Product Details Tab

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #132494

    [email protected]
    Participant

    Currently I have the Details accordion on my product page that is expanded by default on mobile. I would like it to be collapse by default like the other accordions. How would I go about this?

    #132529

    Hello,

    Please add this code to the Theme Settings > Custom CSS > Mobile/Tablet:

    .woodmart-accordion-title {
        cursor:default;
    	pointer-events: none;
    }
    
    .tabs-layout-tabs .woodmart-tab-wrapper .wc-tab {
        display: block!important;
    }
    .tabs-layout-tabs .woodmart-scroll .woodmart-scroll-content {
    	max-height: 100%!important;
    }

    Best Regards

    #132564

    [email protected]
    Participant

    That didn’t work. Now all 3 of my tabs are opened by default and they don’t even collapse when I touch them 🙁

    It gives me two warnings on lines 7 & 10 “Use of !important”

    #132571

    Hello,

    Do you want all of them to be always closed? I cannot figure out what is your purpose. I provided the code to have all the tabs open.

    Please clarify

    Best Regards

    #132855

    [email protected]
    Participant

    I would like the tabs on the product page to be closed by default on mobile. The user should click to expand if he wants to read more.

    Currently the default is that the first one is opened and the others are closed

    #132880

    Hello,

    Add the snippet to the Custom JS section in Theme Settings:

    setTimeout(function() {
    	var $tab = jQuery('.woodmart-tab-wrapper').find('a.active');
    		$tab.siblings('.wc-tab').hide();
    	  $tab.removeClass('active');
    }, 10);

    Best Regards

    #133487

    [email protected]
    Participant

    This did not work. Please see the attached screenshots. As you can see in the current view, the first tab called “Description” is opened and all the content is there. I can close it if I click on it, but I want it to be closed automatically like in the desired screenshot.
    The user should click to read more. I don’t want all that expanded by default.
    This is only for mobile of course. On desktop I do not have an accordion, they are tabs.

    Attachments:
    You must be logged in to view attached files.
    #133539

    Hello,

    You need to add the code to the Theme Settings > Custom JS > on document ready http://prntscr.com/oh7hzb

    Remove it from CSS and insert in JS.

    Best Regards

    #133667

    [email protected]
    Participant

    Ah indeed, that was my mistake.
    One more issue though: now the tabs on desktop are closed by default also (see attached). Can we make this code apply to tablet and mobile only?

    Attachments:
    You must be logged in to view attached files.
    #133693

    Artem Temos
    Keymaster

    Try to replace the code with the following one

    setTimeout(function() {
          if( $(window).width() > 1024 ) return;
    	var $tab = jQuery('.woodmart-tab-wrapper').find('a.active');
    		$tab.siblings('.wc-tab').hide();
    	  $tab.removeClass('active');
    }, 10);

    Regards

    #134631

    [email protected]
    Participant

    This didn’t work either, back to square one as if there were no JS code. The tab is opened correctly on desktop but the description accordion is also opened.

    #134668

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it? Also, send us a link where you have added the code.

    Thank you in advance

    #134722

    [email protected]
    Participant

    see private

    #134757

    Artem Temos
    Keymaster

    Try to replace the code with the following one

    setTimeout(function() {
          if( jQuery(window).width() > 1024 ) return;
    	var $tab = jQuery('.woodmart-tab-wrapper').find('a.active');
    		$tab.siblings('.wc-tab').hide();
    	  $tab.removeClass('active');
    }, 10);
    #134856

    [email protected]
    Participant

    Success! Thank you

    #134864

    Artem Temos
    Keymaster

    Great, you are welcome!

Viewing 16 posts - 1 through 16 (of 16 total)

The topic ‘Collapse Product Details Tab’ is closed to new replies.