- Adds a
storeAvailability
attribute that contains the IDs of stores where a variant is available. - Sends this attribute with every product (variant or product level, depending on your record model).
Before you begin
This feature requires:- Algolia Search & Discovery cartridge 25.3.0 or later
- Salesforce’s
plugin_instorepickup
cartridge
storeAvailability
attribute is updated with the latest inventory level after an order is placed.
Enable store-inventory indexing
- Go to Merchant Tools > Algolia > Algolia in the Business Manager.
- In Additional Product Attributes, append
storeAvailability
and click Apply. Indexing jobs will now recognize this attribute.
- Retrieves each variant’s available‑to‑sell (ATS) value per store.
- Adds the store’s ID to
storeAvailability
if the ATS is ≥ In Stock Threshold (defined in your custom preferences.
JSON
Record model | Location of storeAvailability |
---|---|
Base product | Inside every item in the variants array |
Variant product | At the root level of the record |
Understand the size impact
If you run hundreds of stores,storeAvailability
can add several kilobytes per record.
To limit the impact:
- Use short store IDs or a custom mapping that translates an abbreviated ID to a friendly name on the frontend.
- Use post processing to filter out stores that aren’t relevant to your business.
Add an In stock at store facet
After the attribute exists in your index, create a facet:- Open your products index in the Algolia dashboard.
- Go to Configuration > Facets and add
storeAvailability
as a attributesForFaceting. - Save the settings.
How the storefront resolves the “Store” facet
- The SFRA Search controller passes a JSON array of store details to
searchResultsNoDecorator.isml
aspdict.storeList
. - The
storeAvailability
field in each product record includes astoreIds
array that lists the stores carrying the item. - When the store facet renders, every store ID is looked up in
pdict.storeList
. The frontend displays store names in place of the IDs.