How to add custom jquery javascript to theme.liquid?
Use this code for your Shopify theme.liquid file and add this code before </body>
<script>
window.addEventListener('DOMContentLoaded',(event)=>{
document.querySelectorAll('facet-filters-form details.facets__disclosure-vertical').forEach(item=>{
if(!item.hasAttribute('open')){
item.querySelector('summary').click()
}
})
});
</script>