Manage out-of-stock products
Customize how out of stock products are handled with Algolia AI Search & Discovery.
The Algolia AI Search & Discovery app lets you choose if you want to keep or remove out-of-stock products from the search results.
Out-of-stock policies
Out-of-stock product variants are removed from the search results based on filters.
Filtering relies on the inventory_quantity
and inventory_policy
attributes of the
product variants resource.
A product variant is out-of-stock if the inventory_quantity
attribute is 0.
The inventory_policy
attribute can be allow
if you explicitly decided to continue selling a product when it’s out of stock. Otherwise, this attribute is deny
.
For handling out-of-stock product variants in the search results, you can choose between these policies.
- Include all out-of-stock products in the search results. No filter is applied. All products are included in the search results.
- Remove all out-of-stock products from the search results. A filter
inventory_quantity>0
is applied when searching Only in-stock items are included in the search results. - Remove out-of-stock products, except those marked explicitly as available. A filter
inventory_available:true
is applied when searching. Theinventory_available
attribute is true, when theinventory_quantity
attribute is greater than 0, or when theinventory_policy
attribute is set toallow
for that product.
Select your out-of-stock policy
To select your policy for handling out-of-stock items in the search results:
-
In your Shopify admin, open the Algolia AI Search & Discovery app.
-
On the Search options tab, go to the Additional settings > Out of stock items section.
-
Select your policy for handling out-of-stock items:
-
Show all out of stock items in search results. Out-of-stock items are included in the search results. This is the default.
-
Hide all out of stock items in search results. Out-of-stock items are removed from search results.
-
Hide out of stock items - except those marked as available. Out-of-stock items are removed from search results, except products with the Continue selling when out of stock option. After selecting this option, you might need to reindex your product catalog.
-
Continue selling out-of-stock products
To select which products are included in the search results when they’re out of stock:
- Go to the Products page in your Shopify admin.
- Select a product you want to show in the search result when it’s out of stock.
- In the Inventory section, select Track quantity and Continue selling when out of stock.
The selected products are now included in the search results, even when they’re out of stock.
UI updates
The UI widgets of the Algolia AI Search & Discovery app have been updated to support this feature. You can find the Autocomplete and InstantSearch widgets in these files:
Autocomplete updates
In Autocomplete v1, filters are located in the algolia_autocomplete_product_plugin.js.liquid
file:
In older versions of the Autocomplete widget, the algolia_autocomplete.js.liquid
file includes the following changes:
InstantSearch updates
The algolia_instant_search.js.liquid
file includes the following changes:
Was this page helpful?