What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Is it possible to set default values for shopify filters?

Is it possible to set default values for shopify filters?

sam-uel
Visitor
1 0 1

This is regarding the new shopify storefront filters. I have an availability filter set up for the collection, is it possible to give that filter a default value? (preferably from the Shopify admin) so when the page loads "In-Stock" items are preselected?

Replies 2 (2)

PaulNewton
Shopify Partner
7450 657 1565

Hi @sam-uel afaik there's no setting for preselection in filters and probably never will be*.

There is the new shopify search-and-filter app that may have more control but you would have to investigate.

https://help.shopify.com/en/manual/online-store/search-and-discovery/filters 

 

Currently the easiest ways to solve this is making collection conditions that only include products with stock, then possibly making a counter collection that only contains out of stock products. Because this has the same net effect if you don't want customers to ever see out-stock items as a default.

Alternatively in navigation menus or anywhere a collection link appears to just append the desired filter parameters to the output links.

 

*Even as a customization on the frontend this would present a redirection/refresh/rehydrate problem on every single collection a visitor would visit using a pure handle url vs url with filter parameters.

i.e. https://theme-dawn-demo.myshopify.com/collections/shoes vs https://theme-dawn-demo.myshopify.com/collections/shoes?filter.v.availability=1&filter.v.price.gte=&...  

Think like on product pages how the first available variant is selected with the ?variant= parameter that may slow total page load time in some themes as it updates the content to match the new context.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


brickerking
Tourist
10 0 6

I would like this functionality too.