Shopify dawn theme filters to show always open

Shopify dawn theme filters to show always open

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code

Step 2: Search file theme.liquid

Step 3: Paste the below code before </body> of the file -> Save

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

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *