- Adds a
storeAvailabilityattribute 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_instorepickupcartridge
plugin_instorepickup fully replace SFRA endpoints instead of extending them.
Place the plugin_instorepickup cartridge before app_storefront_base and after the Algolia cartridges.
This order ensures that Algolia extensions to these endpoints aren’t overridden (for example, Cart-AddProduct).
The
plugin_instorepickup cartridge relies on features from B2C Compatibility Mode 21.2, such as Number.isNaN().
If you use compatibility mode 19.10 or 18.10 (the minimum supported by the Algolia cartridge), you may encounter errors.
To resolve these errors, update to compatibility mode 21.2 or later, or adjust the 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
storeAvailabilityand 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
storeAvailabilityif 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 , create a facet:- Open your products index in the Algolia dashboard.
- Go to Configuration > Facets and add
storeAvailabilityas 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.ismlaspdict.storeList. - The
storeAvailabilityfield in each product record includes astoreIdsarray 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.