Accordion (on product page) open by default - Prestige theme

Accordion (on product page) open by default - Prestige theme

Issyeissue
Excursionist
18 0 4

I am trying to set the last accordion (see the image) open by default, tried copying the open by default setting and html from the tabs section into the accordion liquid but still couldnt seem to set it open by default. Anyone know how to do this? Would appreciate it a lot!

 

Screenshot 2024-09-22 at 10.18.09 PM.png

Replies 5 (5)

Huptech-Web
Shopify Partner
930 187 196

Hi @Issyeissue, Can you please share your store URL?

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
Issyeissue
Excursionist
18 0 4
Leonisa.se
Huptech-Web
Shopify Partner
930 187 196

Hi @Issyeissue, Thanks for the URL. I checked and found that to open the last accordion you need to make some changes to the accordion file.

First, you need to open the theme code editor and find the accordion file in Sections. Once you find the file find the "details" tag in your file.

 

Set the attribute aria-expanded='true' and add the attribute open when forloop index is last. Replace the below code in your file.

<details class="accordion group " is="accordion-disclosure" aria-expanded="{% if forloop.last %}true{% else %}false{% endif %}" {% if forloop.last %} open {% endif %} >

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
Issyeissue
Excursionist
18 0 4

Screenshot 2024-09-23 at 9.04.25 AM.png

 

Now it looks like this

Huptech-Web
Shopify Partner
930 187 196

Can you share the code you have made changes so I can check what's the issue.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required