Buy online, pick up in store (BOPIS)
Buy online, pick up in-store (BOPIS) lets shoppers reserve or pay for an item online and collect it from a physical store. This guide shows you how to index store‑level stock information and add an In stock at store facet to your storefront.
BOPIS indexing:
- 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).
It only indicates if the product is available in the store, not the number of available products.
Before you begin
This feature requires:
- Algolia Search & Discovery cartridge 25.3.0 or later
- Salesforce’s
plugin_instorepickup
cartridge
If you enable real-time inventory updates, the 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.
During indexing, the cartridge:
- 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.
1
2
3
4
5
6
// Variant‑level example
{
"objectID": "25523741-blue-xs",
"name": "Essential Tee",
"storeAvailability": ["paris_store", "berlin_store"]
}
Attribute location:
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.