- This topic has 28 replies, 6 voices, and was last updated 1 year, 9 months ago by David.
-
AuthorPosts
-
January 19, 2021 at 9:59 pm #1625802ElvinStaffCustomer Support
Hi,
I’d like the content that now fills the default Description tab on the woocommerce product page to dynamically fill into the accordion content section.
I believe you’re using the code provided here?
https://generatepress.com/forums/topic/collapse-button/#post-1194173This code has an HTML part. You’ll have to add your PHP snippet that prints out dynamic content you want to add within the
accordion-container
<p>
tag.March 19, 2021 at 1:07 pm #1702318MikeThanks Elvin, yes I am using that code.
So I’ll need to add a php snippet to print out whatever text is in description tab on the woocommerce product pages to dynamically fill in the accordion content section. That makes sense. I’m not sure how to go about that though. Can anyone point in the right direction?
Sorry, my skills are still limited.
Thank you
March 20, 2021 at 7:06 am #1702955DavidStaffCustomer SupportHi there,
You can use this function:
wc_get_template( 'single-product/tabs/description.php' );
March 20, 2021 at 10:59 am #1703157MikeThank you David that works perfectly!!
I was struggling with this for a while and then I realized I didn’t have execute php selected below.
March 21, 2021 at 4:42 am #1703624DavidStaffCustomer SupportYou’re welcome
September 7, 2021 at 9:39 pm #1922450Jaime HernandoHello, I need your help please I am using this information to create an accordion, it worked fine, but some time later it stopped working on mobiles, I don’t know what happens and how to fix it, I have removed and placed it again, but it does not work
Thank you so much.
September 7, 2021 at 10:10 pm #1922462ElvinStaffCustomer SupportHi Jaime,
Can you open a new topic for this? So you can use the private information text field to provide the site details so we can check the inspect the site for any issues.
September 7, 2021 at 11:41 pm #1922522AlexandraIt still works on my site (on mobile too), in case that helps.
September 7, 2021 at 11:53 pm #1922527Jaime HernandoAlexandra, I have checked on different mobiles and they don’t work, but if it worked for you, that’s good news for me.
Thanks.September 8, 2021 at 4:35 am #1922788DavidStaffCustomer SupportHi Jaime,
if you want to open a new topic where you can share a link to your site, we can take a quick look.
May not be able to fix it but we can check for obvious issues.Before that – i would recommend disabling any cache/optimization plugins on your site, clear the device browser caches and then see if it works
July 6, 2022 at 5:37 am #2274705MarcelHello again,
I opened this topic on February 18, 2020. With David’s help, I got the desired result at that time.
Now I would have a weird question: do you think it would be possible for the text to be displayed above the button and not below?July 6, 2022 at 6:24 am #2274756DavidStaffCustomer SupportHi there,
has it really been that long lol
in those jQuery scripts we used the
next()
function
Which selects the next sibling in the HTML stacking order.
So when clicking on Heading it opens the next element.If the HTML is swapped then you should be able to simply swap
next()
forprev()
so it targets the previous sibbling element.July 6, 2022 at 7:26 am #2274799MarcelDavid, thank you again! It’s working!
All the best.July 6, 2022 at 7:39 am #2274824DavidStaffCustomer SupportAwesome – glad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.