Add an in-stock filter to url

VT_Steve
Tourist
6 0 2

Our current theme allows a customer to click the Brand name on the product page and they end up with a collection page based on the Brand Name.

For example, clicking on 'the Gift Wrap Company' on the product page results in:

StoreURL/collections/vendors?q=The Gift Wrap Company

I was hoping for a filter I could add to the code so the auto-collection only shows in stock inventory.  Is there a Filter you can add to the URL so the collection only shows in-Stock products?  Something along the lines of:

StoreURL/collections/vendors?q=The Gift Wrap Company+instock=y

Is this possible?

 

0 Likes
Tira
Shopify Staff
Shopify Staff
1120 75 180

Hey, @VT_Steve.

Tira here to help.

Thanks for your question and for these details. I appreciate them and they are helpful.

I would suggest hiding your out-of-stock products from your collections, as this will allow you to only show in-stock products to your customers, and could avoid confusion when customers are browsing your store. You will need to enable inventory tracking in your Shopify admin so that inventory tracking can keep track of the inventory you carry in your store. Here is our help doc with the steps to hide your out-of-stock products on your theme.

Is this what you were looking to do? What kind of products do you carry in your store?

Tira | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
VT_Steve
Tourist
6 0 2

Hello Tira,

We do have that extra filter added to our collections.

It does not work when it is a search.  If someone runs a search, the search returns all products.  If someone clicks a brand name, it shows all products.  Those results are not 'Collections' as created within Shopify.  Because they are not created 'collections' we don't have the extra filter for inventory>0.

There must be some sort of URL filter that can be added to the Liquid code to add 'inventory>0"?

 

0 Likes
Tira
Shopify Staff
Shopify Staff
1120 75 180

Thanks for the details, @VT_Steve. I appreciate it and it is helpful.

It sounds like you want to show only in stock products when someone searches for any product on your store through the search. 

If that’s right, I chatted with my colleagues and searched our help docs and this would be outside our scope of support. We do have a help doc that covers the storefront search and it’s query parameters, the search form and search URL structure that might help: Storefront Search. We also have a help doc that covers how the search works on your store, such as filtering search results, adding a prefix and searchable properties: Searching your store that you might find helpful. We also have this help doc on storefront filtering for collection pages

Do you have a link to a store that has something similar to what you want to do, or a screenshot of what you want to do?

Let us know so that myself and the community can help point you in the right direction. I would also like to submit this as a suggestion to our developers so that they are aware of how we can improve Shopify for you and all of our merchants. If we move forward with this, we will update our changelog and announcements page.

Talk soon,

Tira | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes