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:
User | RANK |
---|---|
42 | |
39 | |
24 | |
24 | |
22 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023