Home Forums WoodMart support forum Single product tabs

Single product tabs

Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #394662

    Georges
    Participant

    Hello, is it possible to have product description field closed and review open when a user visits my single product page? (example attached)

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

    Hello,

    Here is the code to keep them closed on all the devices:

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

    Add the snippet to the Custom JS section in Theme Setting.

    Best Regards

    #394850

    Georges
    Participant

    Hello, Elise!

    As you mentioned, this snippet will close all tabs, but Is it possible to modify that in order to keep first tab (description) closed and second tab (reviews) open?

    regards

    #395117

    Hello,

    Please replace the code with this one:

    if (jQuery(window).width() <= 1024) {
    			setTimeout( function(){ 
    				jQuery('.woocommerce-tabs.wd-accordion').each(function() {
    					let activeClass  = 'wd-active';
    					let time         = 300;
    					let firstItem    = jQuery('.wd-accordion > .wd-accordion-item').first();
    					let secondItem   = firstItem.next();
    					let getTitle     = $item => $item.find('> .wd-accordion-title');
    					let getContent   = $item => $item.find('> .wd-accordion-content');
    
    					getTitle( firstItem ).removeClass(activeClass);
    					getContent( firstItem ).stop(true, true).slideUp(time).removeClass(activeClass);
    
    					getTitle( secondItem ).addClass(activeClass);
    					getContent( secondItem ).stop(true, true).slideDown(time).addClass(activeClass);
    
    					jQuery(this).addClass('wd-inited');
    				});
    			}, 500);
    }

    Best Regards

    #395123

    Georges
    Participant

    Hello, Elise

    I added that to the Custom JS section in Theme Setting but nothing happens (I’ve already cleaned cache)

    #395125

    Georges
    Participant

    I also tried with code snippets and it seems there’s a syntax error.

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

    Hello,

    Please insert the site admin access into the Private content below the message area. We will take a closer look at the case.

    Best Regards

    #395365

    Georges
    Participant

    Information attached.
    Thanks!

    #395396

    Hello,

    Thank you for the access, we will need login URL as well.

    Best Regards

    #395399

    Georges
    Participant

    Hello,

    URL attached!
    kind regards

    #395605

    Hello,

    Please disable the blocking for the period we check and try to solve:

    Access denied Error code 1020
    You do not have access to viyup.com.
    
    The site owner may have set restrictions that prevent you from accessing the site. Contact the site owner for access or try loading the page again.

    Best Regards

    #395606

    Georges
    Participant

    It was caused by cloudflare firewall rules (blocked contries). I deactivated them all, please clear your cache and try again.

    kind regards

    #395805

    Hello,

    Please check now and let us know if it does not work.

    Best Regards

    #395824

    Georges
    Participant

    Hello, Elise

    nothing happens, please let me know if you understand what I’m tryng to accomplish. When user get into some product page, I would like description tab first closed and review tab open (image attached).

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

    Hello,

    I will submit the case to our developer for double-checking.

    Best Regards

    #395977

    Georges
    Participant

    Hello Elise,

    do you have any expected response time from the development team? can I work on the website in the meantime or should I wait?

    #396022

    Hello,

    We will provide the solution within 24 hours. Such delay is caused by weekends.

    If you have any questions please feel free to contact us.

    Best Regards

    #396153

    Hello,

    Thank you for your patience.

    Please try to replace the code provided above with this one:

    if(jQuery(window).width() <= 1024) {
    			setTimeout( function(){ 
    				jQuery('.elementor-widget-wd_single_product_tabs .wd-accordion').each(function() {
    					
    					let activeClass  = 'wd-active';
    					let time         = 300;
    					let firstItem    = jQuery('.wd-accordion > .wd-accordion-item').first();
    					let secondItem   = firstItem.next();
    					let getTitle     = $item => $item.find('> .wd-accordion-title');
    					let getContent   = $item => $item.find('> .wd-accordion-content');
    
    					getTitle( firstItem ).removeClass(activeClass);
    					getContent( firstItem ).stop(true, true).slideUp(time).removeClass(activeClass);
    
    					getTitle( secondItem ).addClass(activeClass);
    					getContent( secondItem ).stop(true, true).slideDown(time).addClass(activeClass);
    
    					jQuery(this).addClass('wd-inited');
    				});
    			}, 500);
    }

    If you have any questions please feel free to contact us.

    Best Regards

    #396201

    Georges
    Participant

    Hello, Elise!

    Which field should i copy this code into? “Global Custom JS” or “On document ready
    Will be executed on $(document).ready()”

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

    Hello,

    You will need to change the location of the tabs, you need to locate Reviews in the first place and Description in the second. Unfortunately, it is not possible to implement it exactly as you describe.

    If you have any questions please feel free to contact us.

    Best Regards

    #396360

    Georges
    Participant

    Hello, Elise

    Actually this last code you mentioned worked perfectly. I just want to know which field shoud I use because I don’t want to break the website, so should I insert this code on Woodmart settings “Global Custom JS” or “On document ready”? (image attached).

    best

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

    Hello,

    Sorry for the confusion.

    I have inserted the code into JS > On document ready, it works on mobile: https://gyazo.com/77573c1ff2b8d0fb5e0d82e9b3b4f9ac

    Please check.

    Best Regards

    #396370

    Georges
    Participant

    Hello, Elise

    Perfect, problem solved. You guys are amazing!

    best (:

    #396469

    You are welcome! We are here to help.

    Wish you a wonderful day!

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