All things Shopify and commerce
My theme, IMPACT by maestrooo has the collection filters built in and one of the options is to filter by "in stock only".
I'm trying to have this filter selected by default, I've played with the code every which way but can seem to get it to work, can anyone help?
Hi @loadout
It is great filter to show your in stock products standout, there is a custom JS code which I can quickly write for you.
----------------------------------------
$(document).ready(function () {
$( '#Switch_option_ID' ).prop( 'checked', true );
});
-----------------------------------------
This small function basically make your toggle switch "On" after the page load. You can add this in any of your liquid code files, with a script tag. Just make sure to change the "Switch_option_ID" to your ID identifier of your filter.
Do not forget to include jQuery CDN before the code.
For ex: in this website, I show what will be the correct identifier for this:
https://prnt.sc/osrMUEtITw9z
"Impact" is a paid theme, so I can help you better if you can share the access to the store and your code.
The code piece I shared above is not tested on your store, so it may require some modifications as per your store.
Hope it helps.
Thanks
We were searching everywhere for this and finally found the Camouflage app which has this feature on the free plan:
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024