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

Open Multiple Sidebar "Filters & sort" Groups by Default (Impact Theme)

Solved

Open Multiple Sidebar "Filters & sort" Groups by Default (Impact Theme)

tdr-solsant
Tourist
9 0 2
Hi all. On my Shop page I have selected "Open first group by default" but I would like both my filter groups open by default. Does anyone know how to achieve this please? Thank you https://chirp-protect.com/collections/shop (Impact Theme)
Accepted Solution (1)

tim
Shopify Partner
4812 598 1733

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>
If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 4 (4)

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

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.

TheScriptFlow
Excursionist
45 1 3

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

- Need a Shopify Specialist? Chat on WhatsApp Or Email at info@thescriptflow.com
- For any custom section queries, bug fixing please visit: Level 2 Fiverr Profile
- Buy Me a Coffee? Nah… Let’s Upgrade to a Car
- If my solution was helpful, mark it as a solution and hit the like button!

Darshan17
Shopify Partner
68 5 9

 

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!


If this fixed your issue, a Like and marking it as a Solution would mean a lot!
Shopify Developer | Helping eCommerce Stores Grow – cmsMinds (Shopify Partner)
Need help improving your Shopify store to stay ahead of market trends or need expert support?
 Connect with me at ujjawal@cmsminds.com

tim
Shopify Partner
4812 598 1733

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>
If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com