Could you please help me with the steps?
Topic summary
A merchant seeks to automatically set the ‘In stock’ filter as default on collection pages, ideally combining it with size filters to show only available inventory for selected sizes.
Proposed Solutions:
-
Custom JavaScript code: One contributor provided jQuery code to auto-select ‘In stock’ in the availability filter, but it failed to work with the Testament theme.
-
URL parameter method: Manually append the ‘In stock’ filter parameter to collection URLs in navigation menus (e.g.,
?filter.v.availability=1). -
Third-party apps: Multiple recommendations emerged:
- Camouflage app (free feature to filter sold-out variants)
- AI Search & Product Filter (hides unavailable variants or shows only available filter options)
- Hide Sold Variants by Scala (reportedly doesn’t impact store speed)
-
Liquid template modification: Use Shopify’s
wherefilter directly in collection liquid files to filter products server-side. -
JavaScript snippet: A code snippet was shared to programmatically click the ‘In stock’ filter on collection pages.
Current Status:
The discussion remains open with multiple viable approaches. The merchant has not confirmed which solution they implemented. One follow-up question asks about hiding the filter UI while keeping the auto-selection active.