[Resolved] Collapse Button

Home Forums Support [Resolved] Collapse Button

Home Forums Support Collapse Button

Viewing 14 posts - 16 through 29 (of 29 total)
  • Author
    Posts
  • #1625802
    Elvin
    Staff
    Customer 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-1194173

    This 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.

    #1702318
    Mike

    Thanks 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

    #1702955
    David
    Staff
    Customer Support

    Hi there,

    You can use this function:

    wc_get_template( 'single-product/tabs/description.php' );

    #1703157
    Mike

    Thank 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.

    #1703624
    David
    Staff
    Customer Support

    You’re welcome

    #1922450
    Jaime Hernando

    Hello, 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.

    #1922462
    Elvin
    Staff
    Customer Support

    Hi 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.

    #1922522
    Alexandra

    It still works on my site (on mobile too), in case that helps.

    #1922527
    Jaime Hernando

    Alexandra, I have checked on different mobiles and they don’t work, but if it worked for you, that’s good news for me.
    Thanks.

    #1922788
    David
    Staff
    Customer Support

    Hi 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

    #2274705
    Marcel

    Hello 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?

    #2274756
    David
    Staff
    Customer Support

    Hi 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() for prev() so it targets the previous sibbling element.

    #2274799
    Marcel

    David, thank you again! It’s working!
    All the best.

    #2274824
    David
    Staff
    Customer Support

    Awesome – glad to hear that!

Viewing 14 posts - 16 through 29 (of 29 total)
  • You must be logged in to reply to this topic.