Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Solved! Go to the solution
This is an accepted solution.
If you do not want to edit theme code, you can add a "Custom liquid" (Custom code?) section to the Collection page template (or Footer group).
Should be below collection sections.
Add this code to this section:
<script>
document.querySelectorAll('#facet-form .accordion:not([open])')
.forEach(s=>{
s.setAttribute('open', '');
s.setAttribute('aria-expanded', true);
s._open=true;
})
</script>
Or this code -- it will be a bit more reliable, but group opening will be more noticeable:
<script>
document.addEventListener('DOMContentLoaded', ()=>{
document.querySelectorAll('#facet-form .accordion:not([open]) summary')
.forEach(s=>{
s.dispatchEvent(new Event('click'));
})
})
</script>
Will need to edit the code of your theme. If you don't mind, please share collab request code of your theme so I can help
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hey @tdr-solsant,
In order to achieve the requested change required to do changes in the custom code.
Would you like to share the collection.liquid file so that I can update it for you.
Thanks
Hello,
If you don’t mind, could you please share the collaborator request? I need to review the code and make some modifications, which will take no more than 15 minutes. You can share the collaborator code in a direct message.
Thank you!
This is an accepted solution.
If you do not want to edit theme code, you can add a "Custom liquid" (Custom code?) section to the Collection page template (or Footer group).
Should be below collection sections.
Add this code to this section:
<script>
document.querySelectorAll('#facet-form .accordion:not([open])')
.forEach(s=>{
s.setAttribute('open', '');
s.setAttribute('aria-expanded', true);
s._open=true;
})
</script>
Or this code -- it will be a bit more reliable, but group opening will be more noticeable:
<script>
document.addEventListener('DOMContentLoaded', ()=>{
document.querySelectorAll('#facet-form .accordion:not([open]) summary')
.forEach(s=>{
s.dispatchEvent(new Event('click'));
})
})
</script>