Home › Forums › WoodMart support forum › Single product tabs
Single product tabs
- This topic has 23 replies, 2 voices, and was last updated 2 years, 4 months ago by Elise Noromit.
-
AuthorPosts
-
July 31, 2022 at 7:57 pm #394662
GeorgesParticipantHello, 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.August 1, 2022 at 6:32 am #394715
Elise NoromitMemberHello,
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
August 1, 2022 at 4:07 pm #394850
GeorgesParticipantHello, 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
August 2, 2022 at 10:13 pm #395117
Elise NoromitMemberHello,
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
August 2, 2022 at 11:23 pm #395123
GeorgesParticipantHello, Elise
I added that to the Custom JS section in Theme Setting but nothing happens (I’ve already cleaned cache)
August 2, 2022 at 11:59 pm #395125
GeorgesParticipantI also tried with code snippets and it seems there’s a syntax error.
Attachments:
You must be logged in to view attached files.August 3, 2022 at 6:01 pm #395360
Elise NoromitMemberHello,
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
August 3, 2022 at 7:38 pm #395365
GeorgesParticipantInformation attached.
Thanks!August 4, 2022 at 4:01 am #395396
Elise NoromitMemberHello,
Thank you for the access, we will need login URL as well.
Best Regards
August 4, 2022 at 5:19 am #395399
GeorgesParticipantHello,
URL attached!
kind regardsAugust 4, 2022 at 10:20 pm #395605
Elise NoromitMemberHello,
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
August 4, 2022 at 10:45 pm #395606
GeorgesParticipantIt was caused by cloudflare firewall rules (blocked contries). I deactivated them all, please clear your cache and try again.
kind regards
August 5, 2022 at 5:26 pm #395805
Elise NoromitMemberHello,
Please check now and let us know if it does not work.
Best Regards
August 5, 2022 at 7:37 pm #395824
GeorgesParticipantHello, 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.August 6, 2022 at 3:05 am #395851
Elise NoromitMemberHello,
I will submit the case to our developer for double-checking.
Best Regards
August 7, 2022 at 5:47 pm #395977
GeorgesParticipantHello 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?
August 8, 2022 at 5:22 am #396022
Elise NoromitMemberHello,
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
August 8, 2022 at 4:24 pm #396153
Elise NoromitMemberHello,
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
August 9, 2022 at 12:19 am #396201
GeorgesParticipantHello, 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.August 9, 2022 at 3:04 pm #396356
Elise NoromitMemberHello,
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
August 9, 2022 at 3:26 pm #396360
GeorgesParticipantHello, 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.August 9, 2022 at 3:37 pm #396363
Elise NoromitMemberHello,
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
August 9, 2022 at 4:12 pm #396370
GeorgesParticipantHello, Elise
Perfect, problem solved. You guys are amazing!
best (:
August 10, 2022 at 7:10 am #396469
Elise NoromitMemberYou are welcome! We are here to help.
Wish you a wonderful day!
-
AuthorPosts
- You must be logged in to create new topics. Login / Register