How to Fix Filtering Bugs with Shopify's Search & Discovery App

You may have ran into issues where you install Shopify's Search & Discovery App hoping to filter Out of Stock products, but they still appear in your feed. Here are a couple solutions that might help.

  1. Products with completely sold out variants and multiple product options are still appearing even though you have the In Stock filter turned on.
  2. Products without Online Inventory (but inventory in other locations) are still showing up.

I. PRODUCTS COMPLETELY SOLD OUT STILL APPEARING IN COLLECTIONS USING IN STOCK FILTER

To address the first issue where completely sold out products with more than one product option were showing up in the Collections, you need to undesrtand some of Shopify's logic.

Shopify sometimes fails to mark multi-option products as "unavailable" at the product level, even when all combinations (variants) are sold out. This can occur when:

  1. All variants have inventory_quantity = 0
  2. But the product still reports available = true at the top level due to how variants are structured in Shopify’s internal filtering logic.

So the Availability filter (which works on the product level) might falsely think:
"This product has options, maybe one is still in stock."
— even though all variants are actually sold out.

To fix this, you could add the following code to your collection.liquid file, right after your "for product in collection.products" loop:

{% assign any_available = false %}
{% for variant in product.variants %}
  {% if variant.available %}
    {% assign any_available = true %}
    {% break %}
  {% endif %}
{% endfor %}

{% if any_available %}
  <!-- Render the product card -->
  {% render 'product-card', product: product %}
{% endif %}

 

II. SOLD OUT PRODUCTS WITHOUT ANY ONLINE INVENTORY STILL DISPLAYING

For this issue, you can change your location/fulfillment settings, and they should behave as you would expect.

1. Check Fulfillment Priority / Location Settings

Go to:

Settings → Shipping and delivery → Manage shipping origin

Then check:

“Assign fulfillment priority” under Shipping profiles

Ensure your Online Store–fulfilling location(s) are at the top.


2. Restrict Which Locations Fulfill Online Orders

Go to:

Settings → Locations

  1. Click on each location
  2. Uncheck: “Fulfill online orders from this location” for any physical/store locations or warehouses that shouldn’t fulfill online store orders
  3. Leave it enabled only for the locations that fulfill Online Store orders

Once this is set, Shopify's inventory logic (including Search & Discovery filters) will only count inventory from those locations.

3. Republish the Collection or Wait for Sync

Changes to fulfillment settings can take a few minutes to propagate, especially for large inventories.

To speed it up:

  • Go to a collection in Shopify Admin
  • Remove a product and re-add it (to force a refresh)

  • Save the collection again
Back to blog